Skip to main content

Managing Secrets with GitOps (Alpha)

important

KOTS GitOps is a legacy feature and is not recommended for use. For modern enterprise customers that prefer software deployment processes that use CI/CD pipelines, Replicated recommends the Helm CLI installation method, which is more commonly used in these types of enterprise environments.

When you enable GitOps, the Replicated admin console pushes the rendered application manifests to the configured git repository. Application manifests often contain secrets and sensitive information that should not be committed to git.

Replicated KOTS v1.18 introduces an integration with SealedSecrets to encrypt secrets before committing. This integration is currently alpha and subject to change in future releases of KOTS. For more information, see the sealed-secrets Github repository.

To enable this integration, a Secret with specific labels must be deployed to the same namespace as the admin console. This secret must contain the SealedSecrets public key and is used by KOTS to replace all Secret objects created by the application and by the admin console.

This Secret must be manually deployed to the same namespace as the admin console. There is currently no way to automate or use the admin console to configure this functionality. The Secret can be named anything unique that does not conflict with application Secrets. The labels in this example YAML file are important and must be used.

apiVersion: v1
kind: Secret
metadata:
name: kots-sealed-secret
namespace: NAMESPACE
labels:
kots.io/buildphase: secret
kots.io/secrettype: sealedsecrets
data:
cert.pem: SEALED_SECRET_KEY

Replace:

  • NAMESPACE with the namespace where the admin console is installed.

  • SEALED_SECRET_KEY with the base64 encoded, sealed Secret public key. The sealed Secret public key is included in the sealed Secret controller logs during startup.

    Example:

    kubectl logs -n kube-system sealed-secrets-controller-7684c7b86c-6bhhw
    2022/04/20 15:49:49 Starting sealed-secrets controller version: 0.17.5
    controller version: 0.17.5
    2022/04/20 15:49:49 Searching for existing private keys
    2022/04/20 15:49:58 New key written to kube-system/sealed-secrets-keyxmwv2
    2022/04/20 15:49:58 Certificate is
    -----BEGIN CERTIFICATE-----
    MIIEzDCCArSgAwIBAgIQIkCjUuODpQV7zK44IB3O9TANBgkqhkiG9w0BAQsFADAA
    MB4XDTIyMDQyMDE1NDk1OFoXDTMyMDQxNzE1NDk1OFowADCCAiIwDQYJKoZIhvcN
    AQEBBQADggIPADCCAgoCggIBAN0cle8eERYUglhGapLQZWYS078cP9yjOZpoUtXe
    mpNE4eLBMo2bDAOopL9YV6TIh2E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rvfZgw/lVMtnnda+XjWh82
    YUORubKqKIM4OBM9RvaTih6k5En70Xh9ouyYgwE0fbUEvFThADVR5fUE0e7/34sE
    oeAONWIZ4sbqewhvKjbYpKOZD7a9GrxCiB5C92WvA1xrI4x6F0EOK0jp16FSNuxN
    us9lhAxX4V7HN3KR+O0msygeb/LAE+Vgcr3ZxlNvkIoLY318vKFsGCPgYTXLk5cs
    uP2mg/JbTuntXaZTP+gM7hd8enugaUcvyX/AtduTeIXgs7KLLRZW+2M+gq/dlRwl
    jCwIzOs3BKuiotGAWACaURFiKhyY+WiEpsIN1H6hswAwY0lcV1rrOeQgg9rfYvoN
    0tXH/eHuyzyHdWt0BX6LLY4cqP2rP5QyP117Vt2i1jY=
    -----END CERTIFICATE-----

    2022/04/20 15:49:58 HTTP server serving on :8080
    ...