cert-manager
by apecloud
A Helm chart for cert-manager
About this chart
cert-manager
cert-manager is a Kubernetes addon to automate the management and issuance of TLS certificates from various issuing sources.
It will ensure certificates are valid and up to date periodically, and attempt to renew certificates at an appropriate time before expiry.
Prerequisites
- Kubernetes 1.22+
Installing the Chart
Full installation instructions, including details on how to configure extra functionality in cert-manager can be found in the installation docs.
Before installing the chart, you must first install the cert-manager CustomResourceDefinition resources. This is performed in a separate step to allow you to easily uninstall and reinstall cert-manager without deleting your installed custom resources.
$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.2/cert-manager.crds.yaml
To install the chart with the release name cert-manager:
## Add the Jetstack Helm repository
$ helm repo add jetstack https://charts.jetstack.io --force-update
## Install the cert-manager helm chart
$ helm install cert-manager --namespace cert-manager --version v1.17.2 jetstack/cert-manager
In order to begin issuing certificates, you will need to set up a ClusterIssuer or Issuer resource (for example, by creating a 'letsencrypt-staging' issuer).
More information on the different types of issuers and how to configure them can be found in our documentation.
For information on how to configure cert-manager to automatically provision Certificates for Ingress resources, take a look at the Securing Ingresses documentation.
Tip: List all releases using
helm list
Upgrading the Chart
Special considerations may be required when upgrading the Helm chart, and these are documented in our full upgrading guide.
Please check here before performing upgrades!
Uninstalling the Chart
To uninstall/delete the cert-manager deployment:
$ helm delete cert-manager --namespace cert-manager
The command removes all the Kubernetes components associated with the chart and deletes the release.
If you want to completely uninstall cert-manager from your cluster, you will also need to delete the previously installed CustomResourceDefinition resources:
$ kubectl delete -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.2/cert-manager.crds.yaml
Configuration
Global
global.imagePullSecrets ~ array
Default value:
[]
Reference to one or more secrets to be used when pulling images. For more information, see Pull an Image from a Private Registry.
For example:
imagePullSecrets:
- name: "image-pull-secret"
global.commonLabels ~ object
Default value:
{}
Labels to apply to all resources.
Please note that this does not add labels to the resources created dynamically by the controllers. For these resources, you have to add the labels in the template in the cert-manager custom resource: For example, podTemplate/ ingressTemplate in ACMEChallengeSolverHTTP01Ingress. For more information, see the cert-manager documentation.
For example, secretTemplate in CertificateSpec
For more information, see the cert-manager documentation.
global.revisionHistoryLimit ~ number
The number of old ReplicaSets to retain to allow rollback (if not set, the default Kubernetes value is set to 10).
global.priorityClassName ~ string
Default value:
""
The optional priority class to be used for the cert-manager pods.
global.rbac.create ~ bool
Default value:
true
Create required ClusterRoles and ClusterRoleBindings for cert-manager.
global.rbac.aggregateClusterRoles ~ bool
Default value:
true
Aggregate ClusterRoles to Kubernetes default user-facing roles. For more information, see User-facing roles
global.podSecurityPolicy.enabled ~ bool
Default value:
false
Create PodSecurityPolicy for cert-manager.
Note that PodSecurityPolicy was deprecated in Kubernetes 1.21 and removed in Kubernetes 1.25.
global.podSecurityPolicy.useAppArmor ~ bool
Default value:
true
Configure the PodSecurityPolicy to use AppArmor.
global.logLevel ~ number
Default value:
2
Set the verbosity of cert-manager. A range of 0 - 6, with 6 being the most verbose.
global.leaderElection.namespace ~ string
Default value:
kube-system
Override the namespace used for the leader election lease.
global.leaderElection.leaseDuration ~ string
The duration that non-leader candidates will wait after observing a leadership renewal until attempting to acquire leadership of a led but unrenewed leader slot. This is effectively the maximum duration that a leader can be stopped before it is replaced by another candidate.
global.leaderElection.renewDeadline ~ string
The interval between attempts by the acting master to renew a leadership slot before it stops leading. This must be less than or equal to the lease duration.
global.leaderElection.retryPeriod ~ string
The duration the clients should wait between attempting acquisition and renewal of a leadership.
installCRDs ~ bool
Default value:
false
This option is equivalent to setting crds.enabled=true and crds.keep=true. Deprecated: use crds.enabled and crds.keep instead.
crds.enabled ~ bool
Default value:
false
This option decides if the CRDs should be installed as part of the Helm installation.
crds.keep ~ bool
Default value:
true
This option makes it so that the "helm.sh/resource-policy": keep annotation is added to the CRD. This will prevent Helm from uninstalling the CRD when the Helm release is uninstalled. WARNING: when the CRDs are removed, all cert-manager custom resources
(Certificates, Issuers, ...) will be removed too by the garbage collector.
Controller
replicaCount ~ number
Default value:
1
The number of replicas of the cert-manager controller to run.
The default is 1, but in production set this to 2 or 3 to provide high availability.
If replicas > 1, consider setting podDisruptionBudget.enabled=true.
Note that cert-manager uses leader election to ensure that there can only be a single instance active at a time.
strategy ~ object
Default value:
{}
Deployment update strategy for the cert-manager controller deployment. For more information, see the Kubernetes documentation.
For example:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
podDisruptionBudget.enabled ~ bool
Default value:
false
Enable or disable the PodDisruptionBudget resource.
This prevents downtime during voluntary disruptions such as during a Node upgrade. For example, the PodDisruptionBudget will block kubectl drain if it is used on the Node where the only remaining cert-manager
Pod is currently running.
podDisruptionBudget.minAvailable ~ unknown
This configures the minimum available pods for disruptions. It can either be set to an integer (e.g. 1) or a percentage value (e.g. 25%).
It cannot be used if maxUnavailable is set.
podDisruptionBudget.maxUnavailable ~ unknown
This configures the maximum unavailable pods for disruptions. It can either be set to an integer (e.g. 1) or a percentage value (e.g. 25%). it cannot be used if minAvailable is set.
featureGates ~ string
Default value:
""
A comma-separated list of feature gates that should be enabled on the controller pod.
maxConcurrentChallenges ~ number
Default value:
60
The maximum number of challenges that can be scheduled as 'processing' at once.
image.registry ~ string
The container registry to pull the manager image from.
image.repository ~ string
Default value:
quay.io/jetstack/cert-manager-controller
The container image for the cert-manager controller.
image.tag ~ string
Override the image tag to deploy by setting this variable. If no value is set, the chart's appVersion is used.
image.digest ~ string
Setting a digest will override any tag.
image.pullPolicy ~ string
Default value:
IfNotPresent
Kubernetes imagePullPolicy on Deployment.
clusterResourceNamespace ~ string
Default value:
""
Override the namespace used to store DNS provider credentials etc. for ClusterIssuer resources. By default, the same namespace as cert-manager is deployed within is used. This namespace will not be automatically created by the Helm chart.
namespace ~ string
Default value:
""
This namespace allows you to define where the services are installed into. If not set then they use the namespace of the release. This is helpful when installing cert manager as a chart dependency (sub chart).
fullnameOverride ~ string
Override the "cert-manager.fullname" value. This value is used as part of most of the names of the resources created by this Helm chart.
nameOverride ~ string
Override the "cert-manager.name" value, which is used to annotate some of the resources that are created by this Chart (using "app.kubernetes.io/name"). NOTE: There are some inconsistencies in the Helm chart when it comes to these annotations (some resources use eg. "cainjector.name" which resolves to the value "cainjector").
serviceAccount.create ~ bool
Default value:
true
Specifies whether a service account should be created.
serviceAccount.name ~ string
The name of the service account to use.
If not set and create is true, a name is generated using the fullname template.
serviceAccount.annotations ~ object
Optional additional annotations to add to the controller's Service Account. Templates are allowed for both keys and values.
Example using templating:
annotations:
"{{ .Chart.Name }}-helm-chart/version": "{{ .Chart.Version }}"
serviceAccount.labels ~ object
Optional additional labels to add to the controller's Service Account.
serviceAccount.automountServiceAccountToken ~ bool
Default value:
true
Automount API credentials for a Service Account.
automountServiceAccountToken ~ bool
Automounting API credentials for a particular pod.
enableCertificateOwnerRef ~ bool
Default value:
false
When this flag is enabled, secrets will be automatically removed when the certificate resource is deleted.
config ~ object
Default value:
{}
This property is used to configure options for the controller pod. This allows setting options that would usually be provided using flags.
If apiVersion and kind are unspecified they default to the current latest version (currently controller.config.cert-manager.io/v1alpha1). You can pin the version by specifying the apiVersion yourself.
For example:
config:
apiVersion: controller.config.cert-manager.io/v1alpha1
kind: ControllerConfiguration
logging:
verbosity: 2
format: text
leaderElectionConfig:
namespace: kube-system
kubernetesAPIQPS: 9000
kubernetesAPIBurst: 9000
numberOfConcurrentWorkers: 200
enableGatewayAPI: true
# Feature gates as of v1.17.0. Listed with their default values.
# See https://cert-manager.io/docs/cli/controller/
featureGates:
AdditionalCertificateOutputFormats: true # BETA - default=true
AllAlpha: false # ALPHA - default=false
AllBeta: false # BETA - default=false
ExperimentalCertificateSigningRequestControllers: false # ALPHA - default=false
ExperimentalGatewayAPISupport: true # BETA - default=true
LiteralCertificateSubject: true # BETA - default=true
NameConstraints: true # BETA - default=true
OtherNames: false # ALPHA - default=false
SecretsFilteredCaching: true # BETA - default=true
ServerSideApply: false # ALPHA - default=false
StableCertificateRequestName: true # BETA - default=true
UseCertificateRequestBasicConstraints: false # ALPHA - default=false
UseDomainQualifiedFinalizer: true # BETA - default=false
ValidateCAA: false # ALPHA - default=false
# Configure the metrics server for TLS
# See https://cert-manager.io/docs/devops-tips/prometheus-metrics/#tls
metricsTLSConfig:
dynamic:
secretNamespace: "cert-manager"
secretName: "cert-manager-metrics-ca"
dnsNames:
- cert-manager-metrics
dns01RecursiveNameservers ~ string
Default value:
""
A comma-separated string with the host and port of the recursive nameservers cert-manager should query.
dns01RecursiveNameserversOnly ~ bool
Default value:
false
Forces cert-manager to use only the recursive nameservers for verification. Enabling this option could cause the DNS01 self check
Deploy cert-manager with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cert-manager 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcert-manager is pinned at v1.17.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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