update
diff --git a/charts/cert-manager/templates/deployment.yaml b/charts/cert-manager/templates/deployment.yaml
index aea5736..fa2af6c 100644
--- a/charts/cert-manager/templates/deployment.yaml
+++ b/charts/cert-manager/templates/deployment.yaml
@@ -15,6 +15,10 @@
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
+ {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}}
+ {{- if not (has (quote .Values.global.revisionHistoryLimit) (list "" (quote ""))) }}
+ revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }}
+ {{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "cert-manager.name" . }}
@@ -39,7 +43,7 @@
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
- {{- if and .Values.prometheus.enabled (not .Values.prometheus.servicemonitor.enabled) }}
+ {{- if and .Values.prometheus.enabled (not (or .Values.prometheus.servicemonitor.enabled .Values.prometheus.podmonitor.enabled)) }}
{{- if not .Values.podAnnotations }}
annotations:
{{- end }}
@@ -48,31 +52,51 @@
prometheus.io/port: '9402'
{{- end }}
spec:
+ {{- if not .Values.serviceAccount.create }}
+ {{- with .Values.global.imagePullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- end }}
serviceAccountName: {{ template "cert-manager.serviceAccountName" . }}
{{- if hasKey .Values "automountServiceAccountToken" }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
{{- end }}
+ enableServiceLinks: {{ .Values.enableServiceLinks }}
{{- with .Values.global.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
+ {{- if (hasKey .Values.global "hostUsers") }}
+ hostUsers: {{ .Values.global.hostUsers }}
+ {{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
- {{- with .Values.volumes }}
+ {{- if or .Values.volumes .Values.config}}
volumes:
+ {{- if .Values.config }}
+ - name: config
+ configMap:
+ name: {{ include "cert-manager.fullname" . }}
+ {{- end }}
+ {{ with .Values.volumes }}
{{- toYaml . | nindent 8 }}
+ {{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-controller
- {{- with .Values.image }}
- image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
- {{- end }}
+ image: "{{ template "cert-manager.image" (tuple .Values.image .Values.imageRegistry .Values.imageNamespace (printf ":%s" .Chart.AppVersion)) }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- {{- if .Values.global.logLevel }}
+ {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}}
+ {{- if not (has (quote .Values.global.logLevel) (list "" (quote ""))) }}
- --v={{ .Values.global.logLevel }}
{{- end }}
+ {{- if .Values.config }}
+ - --config=/var/cert-manager/config/config.yaml
+ {{- end }}
+ {{- $config := default .Values.config "" }}
{{- if .Values.clusterResourceNamespace }}
- --cluster-resource-namespace={{ .Values.clusterResourceNamespace }}
{{- else }}
@@ -90,9 +114,7 @@
- --leader-election-retry-period={{ .retryPeriod }}
{{- end }}
{{- end }}
- {{- with .Values.acmesolver.image }}
- - --acme-http01-solver-image={{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}
- {{- end }}
+ - --acme-http01-solver-image={{ template "cert-manager.image" (tuple .Values.acmesolver.image .Values.imageRegistry .Values.imageNamespace (printf ":%s" .Chart.AppVersion)) }}
{{- with .Values.extraArgs }}
{{- toYaml . | nindent 10 }}
{{- end }}
@@ -110,6 +132,11 @@
{{- if .Values.featureGates }}
- --feature-gates={{ .Values.featureGates }}
{{- end }}
+ {{- if .Values.global.commonLabels }}
+ {{- range $key, $value := .Values.global.commonLabels }}
+ - --acme-http01-solver-extra-labels={{ $key }}={{ $value }}
+ {{- end }}
+ {{- end }}
{{- if .Values.maxConcurrentChallenges }}
- --max-concurrent-challenges={{ .Values.maxConcurrentChallenges }}
{{- end }}
@@ -122,6 +149,12 @@
{{- with .Values.dns01RecursiveNameservers }}
- --dns01-recursive-nameservers={{ . }}
{{- end }}
+ {{- if .Values.disableAutoApproval }}
+ - --controllers=-certificaterequests-approver
+ {{- end }}
+ {{- with .Values.acmesolver.runtimeClassName }}
+ - --acme-http01-solver-runtime-class-name={{ . | quote }}
+ {{- end }}
ports:
- containerPort: 9402
name: http-metrics
@@ -133,9 +166,15 @@
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
- {{- with .Values.volumeMounts }}
+ {{- if or .Values.config .Values.volumeMounts }}
volumeMounts:
+ {{- if .Values.config }}
+ - name: config
+ mountPath: /var/cert-manager/config
+ {{- end }}
+ {{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
+ {{- end }}
{{- end }}
env:
- name: POD_NAMESPACE
@@ -179,9 +218,21 @@
failureThreshold: {{ .failureThreshold }}
{{- end }}
{{- end }}
- {{- with .Values.nodeSelector }}
+ {{- if .Values.extraContainers }}
+ {{- toYaml .Values.extraContainers | nindent 8 }}
+ {{- end }}
+ {{- if .Values.runtimeClassName }}
+ runtimeClassName: {{ .Values.runtimeClassName | quote }}
+ {{- else if .Values.global.runtimeClassName }}
+ runtimeClassName: {{ .Values.global.runtimeClassName | quote }}
+ {{- end }}
+ {{- $nodeSelector := .Values.global.nodeSelector | default dict }}
+ {{- $nodeSelector = merge $nodeSelector (.Values.nodeSelector | default dict) }}
+ {{- with $nodeSelector }}
nodeSelector:
- {{- toYaml . | nindent 8 }}
+ {{- range $key, $value := . }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
{{- end }}
{{- with .Values.affinity }}
affinity:
@@ -202,3 +253,6 @@
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
+ {{- with .Values.hostAliases }}
+ hostAliases: {{ toYaml . | nindent 8 }}
+ {{- end }}