kubernetes-external-secrets

by Trozz

Helm chartv6.3.0App 6.3.0

Kubernetes External Secrets CustomResourceDefinition

About this chart

💂 Kubernetes External Secrets

Kubernetes External Secrets allows you to use external secret management systems (e.g., AWS Secrets Manager) to securely add secrets in Kubernetes. Read more about the design and motivation for Kubernetes External Secrets on the GoDaddy Engineering Blog.

TL;DR;

Assumes you are using Helm V3:

$ helm repo add external-secrets https://external-secrets.github.io/kubernetes-external-secrets/
$ helm install external-secrets/kubernetes-external-secrets --skip-crds

See below for Helm V2 considerations when installing the chart.

Prerequisites

  • Kubernetes 1.12+

Installing the Chart

To install the chart with the release named my-release:

$ helm install my-release external-secrets/kubernetes-external-secrets --skip-crds

Tip: A namespace can be specified by the Helm option '--namespace kube-external-secrets', however know this will not autocreate a namespace like in Helm V2. To do that, also add the --create-namespace flag.

Note: --skip-crds is required in order to ensure the custom resource manager is used and will work for backwards compatibility. In future 4.x releases, this will not be required. See below for how to disable the custom resource manager via the chart.

To install the chart with AWS IAM Roles for Service Accounts:

$ helm install my-release external-secrets/kubernetes-external-secrets --skip-crds --set securityContext.fsGroup=65534 --set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"='arn:aws:iam::111111111111:role/ROLENAME'

Installing the CRD

To install the ExternalSecret CRD via the chart and disable the custom resource manager, you can omit --skip-crds and set customResourceManagerDisabled:

$ helm install external-secrets/kubernetes-external-secrets --name my-release --set customResourceManagerDisabled=true

Helm V2 Considerations

For Helm V2, --skip-crds is not needed, but --name is in order to set the release name:

$ helm install external-secrets/kubernetes-external-secrets --name my-release

If you wish to disable the custom resource manager and install the CRD via Helm V2, then crds.create must also be set:

$ helm install external-secrets/kubernetes-external-secrets --name my-release --set customResourceManagerDisabled=true --set crds.create=true

Uninstalling the Chart

To uninstall/delete the deployment:

helm delete my-release

Configuration

The following table lists the configurable parameters of the kubernetes-external-secrets chart and their default values.

ParameterDescriptionDefault
crds.createFor Helm V2 installations of the chart to install the CRD, for V3 installations use --skip-crds appropriatelyfalse
customResourceManagerDisabledDisables the custom resource manager, requiring the CRD be installed via the chart or other meansfalse
env.AWS_REGIONSet AWS_REGION in Deployment Podus-west-2
env.AWS_INTERMEDIATE_ROLE_ARNSpecifies a role to be assumed before assuming role arn specified in external secrets
env.LOG_LEVELSet the application log levelinfo
env.LOG_MESSAGE_KEYSet the key for log messages log text, for example when running on GCP it might be nice to set to messagemsg
env.USE_HUMAN_READABLE_LOG_LEVELSSets log levels as string instead of ints eg info instead of 30, setting this to any value will switchnil
env.METRICS_PORTSpecify the port for the prometheus metrics server3001
env.ROLE_PERMITTED_ANNOTATIONSpecify the annotation key where to lookup the role arn permission boundariesiam.amazonaws.com/permitted
env.POLLER_INTERVAL_MILLISECONDSSet POLLER_INTERVAL_MILLISECONDS in Deployment Pod10000
env.VAULT_ADDREndpoint for the Vault backend, if using Vaulthttp://127.0.0.1:8200
env.DISABLE_POLLINGDisables backend polling and only updates secrets when ExternalSecret is modified, setting this to any value will disable pollingnil
env.WATCH_TIMEOUTRestarts the external secrets resource watcher if no events have been seen in this time period (miliseconds)60000
env.WATCHED_NAMESPACESLimits which namespaces the controller will watch, by default all namespaces will be watched. Comma separated list qa,stage''
envVarsFromSecret.AWS_ACCESS_KEY_IDSet AWS_ACCESS_KEY_ID (from a secret) in Deployment Pod
envVarsFromSecret.AWS_SECRET_ACCESS_KEYSet AWS_SECRET_ACCESS_KEY (from a secret) in Deployment Pod
envVarsFromSecret.AZURE_TENANT_IDSet AZURE_TENANT_ID (from a secret) in Deployment Pod
envVarsFromSecret.AZURE_CLIENT_IDSet AZURE_CLIENT_ID (from a secret) in Deployment Pod
envVarsFromSecret.AZURE_CLIENT_SECRETSet AZURE_CLIENT_SECRET (from a secret) in Deployment Pod
envVarsFromSecret.ALICLOUD_ENDPOINTSet ALICLOUD_ENDPOINT for KMS Service in Deployment Pod
envVarsFromSecret.ALICLOUD_ACCESS_KEY_IDSet ALICLOUD_ACCESS_KEY_ID (from a secret) in Deployment Pod
envVarsFromSecret.ALICLOUD_ACCESS_KEY_SECRETSet ALICLOUD_ACCESS_KEY_SECRET (from a secret) in Deployment Pod
image.repositorykubernetes-external-secrets Image namegodaddy/kubernetes-external-secrets
image.tagkubernetes-external-secrets Image tag6.0.0
image.pullPolicyImage pull policyIfNotPresent
nameOverrideOverride the name of appnil
fullnameOverrideOverride the full name of appnil
rbac.createCreate & use RBAC resourcestrue
securityContextPod-wide security context{ runAsNonRoot: true }
serviceAccount.createWhether a new service account name should be created.true
serviceAccount.nameService account to be used.automatically generated
serviceAccount.annotationsAnnotations to be added to service accountnil
podAnnotationsAnnotations to be added to pods{}
podLabelsAdditional labels to be added to pods{}
priorityClassNamePriority class to be assigned to pods
replicaCountNumber of replicas1
nodeSelectornode labels for pod assignment{}
tolerationsList of node taints to tolerate (requires Kubernetes >= 1.6)[]
affinityAffinity for pod assignment{}
resourcesPod resource requests & limits{}
dnsConfigDns Config for pod.{}
imagePullSecretsReference to one or more secrets to be used when pulling images[]
podDisruptionBudgetPodDisruptionBudget for pod.{}
serviceMonitor.enabledEnable the creation of a serviceMonitor object for the Prometheus operatorfalse
serviceMonitor.intervalThe interval the Prometheus endpoint is scraped30s
serviceMonitor.namespaceThe namespace where the serviceMonitor object has to be creatednil

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm install my-release external-secrets/kubernetes-external-secrets \
--set customResourceManagerDisabled=true
--set env.POLLER_INTERVAL_MILLISECONDS='300000' \
--set podAnnotations."iam\.amazonaws\.com/role"='Name-Of-IAM-Role-With-SecretManager-Access'

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

helm install my-release external-secrets/kubernetes-external-secrets -f values.yaml

Tip: You can use the default [values.yaml](https://github.com/external-secrets/kubernetes-

Deploy kubernetes-external-secrets with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubernetes-external-secrets on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkubernetes-external-secrets is pinned at v6.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply