Back to Sealed Secrets

Sealed Secrets

site/content/docs/latest/project/chart-readme.md

0.36.633.7 KB
Original Source

Sealed Secrets

Sealed Secrets are "one-way" encrypted K8s Secrets that can be created by anyone, but can only be decrypted by the controller running in the target cluster recovering the original object.

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- END doctoc generated TOC please keep comment here to allow auto-update -->

TL;DR

console
$ helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
$ helm install my-release sealed-secrets/sealed-secrets

Introduction

Bitnami charts for Helm are carefully engineered, actively maintained and are the quickest and easiest way to deploy containers on a Kubernetes cluster that are ready to handle production workloads.

This chart bootstraps a Sealed Secret Controller Deployment in Kubernetes using the Helm package manager.

Bitnami charts can be used with Kubeapps for the deployment and management of Helm Charts in clusters.

Prerequisites

  • Kubernetes 1.16+
  • Helm 3.1.0

Installing the Chart

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

console
helm install my-release sealed-secrets/sealed-secrets

The command deploys the Sealed Secrets controller on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

console
helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Parameters

Common parameters

NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override sealed-secrets.fullname""
fullnameOverrideString to fully override sealed-secrets.fullname""
namespaceNamespace where to deploy the Sealed Secrets controller""
extraDeployArray of extra objects to deploy with the release[]
commonAnnotationsAnnotations to add to all deployed resources{}
commonLabelsLabels to add to all deployed resources{}

Sealed Secrets Parameters

NameDescriptionValue
image.registrySealed Secrets image registrydocker.io
image.repositorySealed Secrets image repositorybitnami/sealed-secrets-controller
image.tagSealed Secrets image tag (immutable tags are recommended)0.36.1
image.pullPolicySealed Secrets image pull policyIfNotPresent
image.pullSecretsSealed Secrets image pull secrets[]
revisionHistoryLimitNumber of old history to retain to allow rollback (If not set, default Kubernetes value is set to 10)""
createControllerSpecifies whether the Sealed Secrets controller should be createdtrue
secretNameThe name of an existing TLS secret containing the key used to encrypt secretssealed-secrets-key
updateStatusSpecifies whether the Sealed Secrets controller should update the status subresourcetrue
skipRecreateSpecifies whether the Sealed Secrets controller should skip recreating removed secretsfalse
keyrenewperiodSpecifies key renewal period. Default 30 days""
keyttlSpecifies the certificate validity duration. Default 10 years.""
keycutofftimeSpecifies a date at which the controller should generate a new certificate. Useful in early key renewal scenarios.""
rateLimitNumber of allowed sustained request per second for verify endpoint""
rateLimitBurstNumber of requests allowed to exceed the rate limit per second for verify endpoint""
additionalNamespacesList of namespaces used to manage the Sealed Secrets[]
privateKeyAnnotationsMap of annotations to be set on the sealing keypairs{}
privateKeyLabelsMap of labels to be set on the sealing keypairs{}
logInfoStdoutSpecifies whether the Sealed Secrets controller will log info to stdoutfalse
logLevelSpecifies log level of controller (INFO,ERROR)""
logFormatSpecifies log format (text,json)""
maxRetriesNumber of maximum retries""
watchForSecretsSpecifies whether the Sealed Secrets controller will watch for new secretsfalse
kubeClientQPSKubeclient QPS (negative value disables ratelimiting)""
kubeClientBurstKubeclient Burst""
commandOverride default container command[]
argsOverride default container args[]
livenessProbe.enabledEnable livenessProbe on Sealed Secret containerstrue
livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe0
livenessProbe.periodSecondsPeriod seconds for livenessProbe10
livenessProbe.timeoutSecondsTimeout seconds for livenessProbe1
livenessProbe.failureThresholdFailure threshold for livenessProbe3
livenessProbe.successThresholdSuccess threshold for livenessProbe1
readinessProbe.enabledEnable readinessProbe on Sealed Secret containerstrue
readinessProbe.initialDelaySecondsInitial delay seconds for readinessProbe0
readinessProbe.periodSecondsPeriod seconds for readinessProbe10
readinessProbe.timeoutSecondsTimeout seconds for readinessProbe1
readinessProbe.failureThresholdFailure threshold for readinessProbe3
readinessProbe.successThresholdSuccess threshold for readinessProbe1
startupProbe.enabledEnable startupProbe on Sealed Secret containersfalse
startupProbe.initialDelaySecondsInitial delay seconds for startupProbe0
startupProbe.periodSecondsPeriod seconds for startupProbe10
startupProbe.timeoutSecondsTimeout seconds for startupProbe1
startupProbe.failureThresholdFailure threshold for startupProbe3
startupProbe.successThresholdSuccess threshold for startupProbe1
customLivenessProbeCustom livenessProbe that overrides the default one{}
customReadinessProbeCustom readinessProbe that overrides the default one{}
customStartupProbeCustom startupProbe that overrides the default one{}
resources.limitsThe resources limits for the Sealed Secret containers{}
resources.requestsThe requested resources for the Sealed Secret containers{}
podSecurityContext.enabledEnabled Sealed Secret pods' Security Contexttrue
podSecurityContext.fsGroupSet Sealed Secret pod's Security Context fsGroup65534
containerSecurityContext.enabledEnabled Sealed Secret containers' Security Contexttrue
containerSecurityContext.readOnlyRootFilesystemWhether the Sealed Secret container has a read-only root filesystemtrue
containerSecurityContext.runAsNonRootIndicates that the Sealed Secret container must run as a non-root usertrue
containerSecurityContext.runAsUserSet Sealed Secret containers' Security Context runAsUser1001
containerSecurityContext.capabilitiesAdds and removes POSIX capabilities from running containers (see values.yaml)
podLabelsExtra labels for Sealed Secret pods{}
podAnnotationsAnnotations for Sealed Secret pods{}
priorityClassNameSealed Secret pods' priorityClassName""
runtimeClassNameSealed Secret pods' runtimeClassName""
affinityAffinity for Sealed Secret pods assignment{}
nodeSelectorNode labels for Sealed Secret pods assignment{}
tolerationsTolerations for Sealed Secret pods assignment[]
additionalVolumesExtra Volumes for the Sealed Secrets Controller Deployment{}
additionalVolumeMountsExtra volumeMounts for the Sealed Secrets Controller container{}
hostNetworkSealed Secrets pods' hostNetworkfalse
containerPorts.httpController HTTP Port on the Host and Container8080
containerPorts.metricsMetrics HTTP Port on the Host and Container8081
hostPorts.httpController HTTP Port on the Host""
hostPorts.metricsMetrics HTTP Port on the Host""
dnsPolicySealed Secrets pods' dnsPolicy""

Traffic Exposure Parameters

NameDescriptionValue
service.typeSealed Secret service typeClusterIP
service.loadBalancerClassSealed Secret service loadBalancerClass""
service.portSealed Secret service HTTP port8080
service.nodePortNode port for HTTP""
service.annotationsAdditional custom annotations for Sealed Secret service{}
ingress.enabledEnable ingress record generation for Sealed Secretfalse
ingress.pathTypeIngress path typeImplementationSpecific
ingress.apiVersionForce Ingress API version (automatically detected if not set)""
ingress.ingressClassNameIngressClass that will be be used to implement the Ingress""
ingress.hostnameDefault host for the ingress recordsealed-secrets.local
ingress.pathDefault path for the ingress record/v1/cert.pem
ingress.annotationsAdditional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations.{}
ingress.tlsEnable TLS configuration for the host defined at ingress.hostname parameterfalse
ingress.selfSignedCreate a TLS secret for this ingress record using self-signed certificates generated by Helmfalse
ingress.extraHostsAn array with additional hostname(s) to be covered with the ingress record[]
ingress.extraPathsAn array with additional arbitrary paths that may need to be added to the ingress under the main host[]
ingress.extraTlsTLS configuration for additional hostname(s) to be covered with this ingress record[]
ingress.secretsCustom TLS certificates as secrets[]
networkPolicy.enabledSpecifies whether a NetworkPolicy should be createdfalse
networkPolicy.egress.enabledSpecifies wheter a egress is set in the NetworkPolicyfalse
networkPolicy.egress.kubeapiCidrSpecifies the kubeapiCidr, which is the only egress allowed. If not set, kubeapiCidr will be found using Helm lookup""
networkPolicy.egress.kubeapiPortSpecifies the kubeapiPort, which is the only egress allowed. If not set, kubeapiPort will be found using Helm lookup""

Other Parameters

NameDescriptionValue
serviceAccount.annotationsAnnotations for Sealed Secret service account{}
serviceAccount.createSpecifies whether a ServiceAccount should be createdtrue
serviceAccount.labelsExtra labels to be added to the ServiceAccount{}
serviceAccount.nameThe name of the ServiceAccount to use.""
rbac.createSpecifies whether RBAC resources should be createdtrue
rbac.clusterRoleSpecifies whether the Cluster Role resource should be createdtrue
rbac.clusterRoleNameSpecifies the name for the Cluster Role resourcesecrets-unsealer
rbac.namespacedRolesSpecifies whether the namespaced Roles should be created (in each of the specified additionalNamespaces)false
rbac.namespacedRolesNameSpecifies the name for the namespaced Role resourcesecrets-unsealer
rbac.labelsExtra labels to be added to RBAC resources{}
rbac.pspEnabledPodSecurityPolicyfalse
rbac.serviceProxier.createSpecifies whether to create the "proxier" role, to allow external users to access the SealedSecret APItrue
rbac.serviceProxier.bindSpecifies whether to create a RoleBinding for the "proxier" roletrue
rbac.serviceProxier.subjectsSpecifies the RBAC subjects to grant the "proxier" role to, in the created RoleBinding<pre><code>- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:authenticated</code></pre>

Metrics parameters

NameDescriptionValue
metrics.serviceMonitor.enabledSpecify if a ServiceMonitor will be deployed for Prometheus Operatorfalse
metrics.serviceMonitor.namespaceNamespace where Prometheus Operator is running in""
metrics.serviceMonitor.labelsExtra labels for the ServiceMonitor{}
metrics.serviceMonitor.annotationsExtra annotations for the ServiceMonitor{}
metrics.serviceMonitor.intervalHow frequently to scrape metrics""
metrics.serviceMonitor.scrapeTimeoutTimeout after which the scrape is ended""
metrics.serviceMonitor.honorLabelsSpecify if ServiceMonitor endPoints will honor labelstrue
metrics.serviceMonitor.metricRelabelingsSpecify additional relabeling of metrics[]
metrics.serviceMonitor.relabelingsSpecify general relabeling[]
metrics.dashboards.createSpecifies whether a ConfigMap with a Grafana dashboard configuration should be createdfalse
metrics.dashboards.labelsExtra labels to be added to the Grafana dashboard ConfigMap{}
metrics.dashboards.annotationsAnnotations to be added to the Grafana dashboard ConfigMap{}
metrics.dashboards.namespaceNamespace where Grafana dashboard ConfigMap is deployed""
metrics.service.typeSealed Secret Metrics service typeClusterIP
metrics.service.loadBalancerClassSealed Secret Metrics service loadBalancerClass""
metrics.service.portSealed Secret service Metrics HTTP port8081
metrics.service.nodePortNode port for HTTP""
metrics.service.annotationsAdditional custom annotations for Sealed Secret Metrics service{}

PodDisruptionBudget Parameters

NameDescriptionValue
pdb.createSpecifies whether a PodDisruptionBudget should be createdfalse
pdb.minAvailableThe minimum number of pods (non number to omit)1
pdb.maxUnavailableThe maximum number of unavailable pods (non number to omit)""

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

console
$ helm install my-release \
  --set resources.requests.cpu=25m \
    sealed-secrets/sealed-secrets

The above command sets the resources.requests.cpu parameter to 25m.

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

console
helm install my-release -f values.yaml sealed-secrets/sealed-secrets

Using kubeseal

Install the kubeseal CLI by downloading the binary from sealed-secrets/releases.

Fetch the public key by passing the release name and namespace:

bash
kubeseal --fetch-cert \
--controller-name=my-release \
--controller-namespace=my-release-namespace \
> pub-cert.pem

Read about kubeseal usage on sealed-secrets docs.

NOTE: the helm chart by default installs the controller with the name sealed-secrets, while the kubeseal command line interface (CLI) tries to access the controller with the name sealed-secrets-controller. You can explicitly pass --controller-name to the CLI:

bash
kubeseal --controller-name sealed-secrets <args>

Alternatively, you can override fullnameOverride on the helm chart install.

Configuration and installation details

  • In the case that serviceAccount.create is false and rbac.create is true it is expected for a ServiceAccount with the name serviceAccount.name to exist in the same namespace as this chart before the installation.
  • If rbac.create is `true, by default clusterRoles are created. To switch to namespaced Roles:
    1. set the required namespaces in additionalNamespaces
    2. set rbac.clusterRole to false
    3. set rbac.namespacedRoles to true
  • If serviceAccount.create is true there cannot be an existing service account with the name serviceAccount.name.
  • If a secret with name secretName does not exist in the same namespace as this chart, then on install one will be created. If a secret already exists with this name the keys inside will be used.
  • OpenShift: unset the runAsUser and fsGroup like this when installing in a custom namespace:
yaml
podSecurityContext:
  fsGroup:

containerSecurityContext:
  runAsUser:

Troubleshooting

Find more information about how to deal with common errors related to Bitnami's Helm charts in this troubleshooting guide.

Upgrading

To 2.0.0

A major refactoring of the chart has been performed to adopt several common practices for Helm charts. Upgrades from previous chart versions should work, however, the values structure experienced several changes and you'll have to adapt your custom values/parameters so they're aligned with the new structure. For instance, these are a couple of examples:

  • controller.create renamed as createController.
  • securityContext.* parameters are deprecated in favor of podSecurityContext.*, and containerSecurityContext.* ones.
  • image.repository changed to image.registry/image.repository.
  • ingress.hosts[0] changed to ingress.hostname.

Consult the Parameters section to obtain more info about the available parameters.

On November 13, 2020, Helm v2 support was formally finished, this new major version is no longer compatible with Helm v2.