| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 1 | apiVersion: apps/v1 |
| 2 | kind: Deployment |
| 3 | metadata: |
| 4 | name: {{ template "cert-manager.fullname" . }} |
| 5 | namespace: {{ include "cert-manager.namespace" . }} |
| 6 | labels: |
| 7 | app: {{ template "cert-manager.name" . }} |
| 8 | app.kubernetes.io/name: {{ template "cert-manager.name" . }} |
| 9 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 10 | app.kubernetes.io/component: "controller" |
| 11 | {{- include "labels" . | nindent 4 }} |
| 12 | {{- with .Values.deploymentAnnotations }} |
| 13 | annotations: |
| 14 | {{- toYaml . | nindent 4 }} |
| 15 | {{- end }} |
| 16 | spec: |
| 17 | replicas: {{ .Values.replicaCount }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 18 | {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}} |
| 19 | {{- if not (has (quote .Values.global.revisionHistoryLimit) (list "" (quote ""))) }} |
| 20 | revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }} |
| 21 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 22 | selector: |
| 23 | matchLabels: |
| 24 | app.kubernetes.io/name: {{ template "cert-manager.name" . }} |
| 25 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 26 | app.kubernetes.io/component: "controller" |
| 27 | {{- with .Values.strategy }} |
| 28 | strategy: |
| 29 | {{- toYaml . | nindent 4 }} |
| 30 | {{- end }} |
| 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | app: {{ template "cert-manager.name" . }} |
| 35 | app.kubernetes.io/name: {{ template "cert-manager.name" . }} |
| 36 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 37 | app.kubernetes.io/component: "controller" |
| 38 | {{- include "labels" . | nindent 8 }} |
| 39 | {{- with .Values.podLabels }} |
| 40 | {{- toYaml . | nindent 8 }} |
| 41 | {{- end }} |
| 42 | {{- with .Values.podAnnotations }} |
| 43 | annotations: |
| 44 | {{- toYaml . | nindent 8 }} |
| 45 | {{- end }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 46 | {{- if and .Values.prometheus.enabled (not (or .Values.prometheus.servicemonitor.enabled .Values.prometheus.podmonitor.enabled)) }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 47 | {{- if not .Values.podAnnotations }} |
| 48 | annotations: |
| 49 | {{- end }} |
| 50 | prometheus.io/path: "/metrics" |
| 51 | prometheus.io/scrape: 'true' |
| 52 | prometheus.io/port: '9402' |
| 53 | {{- end }} |
| 54 | spec: |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 55 | {{- if not .Values.serviceAccount.create }} |
| 56 | {{- with .Values.global.imagePullSecrets }} |
| 57 | imagePullSecrets: |
| 58 | {{- toYaml . | nindent 8 }} |
| 59 | {{- end }} |
| 60 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 61 | serviceAccountName: {{ template "cert-manager.serviceAccountName" . }} |
| 62 | {{- if hasKey .Values "automountServiceAccountToken" }} |
| 63 | automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} |
| 64 | {{- end }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 65 | enableServiceLinks: {{ .Values.enableServiceLinks }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 66 | {{- with .Values.global.priorityClassName }} |
| 67 | priorityClassName: {{ . | quote }} |
| 68 | {{- end }} |
| gio | d55d03a | 2026-07-23 16:57:48 +0400 | [diff] [blame] | 69 | {{- if (hasKey .Values.global "hostUsers") }} |
| gio | 15aa663 | 2026-07-23 17:14:23 +0400 | [diff] [blame] | 70 | hostUsers: {{ .Values.global.hostUsers }} |
| gio | d55d03a | 2026-07-23 16:57:48 +0400 | [diff] [blame] | 71 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 72 | {{- with .Values.securityContext }} |
| 73 | securityContext: |
| 74 | {{- toYaml . | nindent 8 }} |
| 75 | {{- end }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 76 | {{- if or .Values.volumes .Values.config}} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 77 | volumes: |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 78 | {{- if .Values.config }} |
| gio | 15aa663 | 2026-07-23 17:14:23 +0400 | [diff] [blame] | 79 | - name: config |
| 80 | configMap: |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 81 | name: {{ include "cert-manager.fullname" . }} |
| 82 | {{- end }} |
| 83 | {{ with .Values.volumes }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 84 | {{- toYaml . | nindent 8 }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 85 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 86 | {{- end }} |
| 87 | containers: |
| 88 | - name: {{ .Chart.Name }}-controller |
| gio | c895c1d | 2026-07-23 17:18:25 +0400 | [diff] [blame] | 89 | image: "{{ template "cert-manager.image" (tuple .Values.image .Values.imageRegistry .Values.imageNamespace (printf ":%s" .Chart.AppVersion)) }}" |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 90 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 91 | args: |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 92 | {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}} |
| 93 | {{- if not (has (quote .Values.global.logLevel) (list "" (quote ""))) }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 94 | - --v={{ .Values.global.logLevel }} |
| 95 | {{- end }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 96 | {{- if .Values.config }} |
| 97 | - --config=/var/cert-manager/config/config.yaml |
| 98 | {{- end }} |
| 99 | {{- $config := default .Values.config "" }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 100 | {{- if .Values.clusterResourceNamespace }} |
| 101 | - --cluster-resource-namespace={{ .Values.clusterResourceNamespace }} |
| 102 | {{- else }} |
| 103 | - --cluster-resource-namespace=$(POD_NAMESPACE) |
| 104 | {{- end }} |
| 105 | {{- with .Values.global.leaderElection }} |
| 106 | - --leader-election-namespace={{ .namespace }} |
| 107 | {{- if .leaseDuration }} |
| 108 | - --leader-election-lease-duration={{ .leaseDuration }} |
| 109 | {{- end }} |
| 110 | {{- if .renewDeadline }} |
| 111 | - --leader-election-renew-deadline={{ .renewDeadline }} |
| 112 | {{- end }} |
| 113 | {{- if .retryPeriod }} |
| 114 | - --leader-election-retry-period={{ .retryPeriod }} |
| 115 | {{- end }} |
| 116 | {{- end }} |
| gio | c895c1d | 2026-07-23 17:18:25 +0400 | [diff] [blame] | 117 | - --acme-http01-solver-image={{ template "cert-manager.image" (tuple .Values.acmesolver.image .Values.imageRegistry .Values.imageNamespace (printf ":%s" .Chart.AppVersion)) }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 118 | {{- with .Values.extraArgs }} |
| 119 | {{- toYaml . | nindent 10 }} |
| 120 | {{- end }} |
| 121 | {{- with .Values.ingressShim }} |
| 122 | {{- if .defaultIssuerName }} |
| 123 | - --default-issuer-name={{ .defaultIssuerName }} |
| 124 | {{- end }} |
| 125 | {{- if .defaultIssuerKind }} |
| 126 | - --default-issuer-kind={{ .defaultIssuerKind }} |
| 127 | {{- end }} |
| 128 | {{- if .defaultIssuerGroup }} |
| 129 | - --default-issuer-group={{ .defaultIssuerGroup }} |
| 130 | {{- end }} |
| 131 | {{- end }} |
| 132 | {{- if .Values.featureGates }} |
| 133 | - --feature-gates={{ .Values.featureGates }} |
| 134 | {{- end }} |
| gio | c895c1d | 2026-07-23 17:18:25 +0400 | [diff] [blame] | 135 | {{- if .Values.global.commonLabels }} |
| 136 | {{- range $key, $value := .Values.global.commonLabels }} |
| 137 | - --acme-http01-solver-extra-labels={{ $key }}={{ $value }} |
| 138 | {{- end }} |
| 139 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 140 | {{- if .Values.maxConcurrentChallenges }} |
| 141 | - --max-concurrent-challenges={{ .Values.maxConcurrentChallenges }} |
| 142 | {{- end }} |
| Giorgi Lekveishvili | 0048a78 | 2023-06-20 18:32:21 +0400 | [diff] [blame] | 143 | {{- if .Values.enableCertificateOwnerRef }} |
| 144 | - --enable-certificate-owner-ref=true |
| 145 | {{- end }} |
| 146 | {{- if .Values.dns01RecursiveNameserversOnly }} |
| 147 | - --dns01-recursive-nameservers-only=true |
| 148 | {{- end }} |
| 149 | {{- with .Values.dns01RecursiveNameservers }} |
| 150 | - --dns01-recursive-nameservers={{ . }} |
| 151 | {{- end }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 152 | {{- if .Values.disableAutoApproval }} |
| 153 | - --controllers=-certificaterequests-approver |
| 154 | {{- end }} |
| gio | c895c1d | 2026-07-23 17:18:25 +0400 | [diff] [blame] | 155 | {{- with .Values.acmesolver.runtimeClassName }} |
| 156 | - --acme-http01-solver-runtime-class-name={{ . | quote }} |
| 157 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 158 | ports: |
| 159 | - containerPort: 9402 |
| 160 | name: http-metrics |
| 161 | protocol: TCP |
| Giorgi Lekveishvili | 0048a78 | 2023-06-20 18:32:21 +0400 | [diff] [blame] | 162 | - containerPort: 9403 |
| 163 | name: http-healthz |
| 164 | protocol: TCP |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 165 | {{- with .Values.containerSecurityContext }} |
| 166 | securityContext: |
| 167 | {{- toYaml . | nindent 12 }} |
| 168 | {{- end }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 169 | {{- if or .Values.config .Values.volumeMounts }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 170 | volumeMounts: |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 171 | {{- if .Values.config }} |
| gio | 15aa663 | 2026-07-23 17:14:23 +0400 | [diff] [blame] | 172 | - name: config |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 173 | mountPath: /var/cert-manager/config |
| 174 | {{- end }} |
| 175 | {{- with .Values.volumeMounts }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 176 | {{- toYaml . | nindent 12 }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 177 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 178 | {{- end }} |
| 179 | env: |
| 180 | - name: POD_NAMESPACE |
| 181 | valueFrom: |
| 182 | fieldRef: |
| 183 | fieldPath: metadata.namespace |
| 184 | {{- with .Values.extraEnv }} |
| 185 | {{- toYaml . | nindent 10 }} |
| 186 | {{- end }} |
| 187 | {{- with .Values.http_proxy }} |
| 188 | - name: HTTP_PROXY |
| 189 | value: {{ . }} |
| 190 | {{- end }} |
| 191 | {{- with .Values.https_proxy }} |
| 192 | - name: HTTPS_PROXY |
| 193 | value: {{ . }} |
| 194 | {{- end }} |
| 195 | {{- with .Values.no_proxy }} |
| 196 | - name: NO_PROXY |
| 197 | value: {{ . }} |
| 198 | {{- end }} |
| 199 | {{- with .Values.resources }} |
| 200 | resources: |
| 201 | {{- toYaml . | nindent 12 }} |
| 202 | {{- end }} |
| Giorgi Lekveishvili | 0048a78 | 2023-06-20 18:32:21 +0400 | [diff] [blame] | 203 | |
| 204 | {{- with .Values.livenessProbe }} |
| 205 | {{- if .enabled }} |
| 206 | # LivenessProbe settings are based on those used for the Kubernetes |
| 207 | # controller-manager. See: |
| 208 | # https://github.com/kubernetes/kubernetes/blob/806b30170c61a38fedd54cc9ede4cd6275a1ad3b/cmd/kubeadm/app/util/staticpod/utils.go#L241-L245 |
| 209 | livenessProbe: |
| 210 | httpGet: |
| 211 | port: http-healthz |
| 212 | path: /livez |
| 213 | scheme: HTTP |
| 214 | initialDelaySeconds: {{ .initialDelaySeconds }} |
| 215 | periodSeconds: {{ .periodSeconds }} |
| 216 | timeoutSeconds: {{ .timeoutSeconds }} |
| 217 | successThreshold: {{ .successThreshold }} |
| 218 | failureThreshold: {{ .failureThreshold }} |
| 219 | {{- end }} |
| 220 | {{- end }} |
| gio | 15aa663 | 2026-07-23 17:14:23 +0400 | [diff] [blame] | 221 | {{- if .Values.extraContainers }} |
| 222 | {{- toYaml .Values.extraContainers | nindent 8 }} |
| 223 | {{- end }} |
| gio | c895c1d | 2026-07-23 17:18:25 +0400 | [diff] [blame] | 224 | {{- if .Values.runtimeClassName }} |
| 225 | runtimeClassName: {{ .Values.runtimeClassName | quote }} |
| 226 | {{- else if .Values.global.runtimeClassName }} |
| 227 | runtimeClassName: {{ .Values.global.runtimeClassName | quote }} |
| 228 | {{- end }} |
| gio | d55d03a | 2026-07-23 16:57:48 +0400 | [diff] [blame] | 229 | {{- $nodeSelector := .Values.global.nodeSelector | default dict }} |
| 230 | {{- $nodeSelector = merge $nodeSelector (.Values.nodeSelector | default dict) }} |
| 231 | {{- with $nodeSelector }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 232 | nodeSelector: |
| gio | b6e9f2f | 2026-07-23 16:53:10 +0400 | [diff] [blame] | 233 | {{- range $key, $value := . }} |
| 234 | {{ $key }}: {{ $value | quote }} |
| 235 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 236 | {{- end }} |
| 237 | {{- with .Values.affinity }} |
| 238 | affinity: |
| 239 | {{- toYaml . | nindent 8 }} |
| 240 | {{- end }} |
| 241 | {{- with .Values.tolerations }} |
| 242 | tolerations: |
| 243 | {{- toYaml . | nindent 8 }} |
| 244 | {{- end }} |
| 245 | {{- with .Values.topologySpreadConstraints }} |
| 246 | topologySpreadConstraints: |
| 247 | {{- toYaml . | nindent 8 }} |
| 248 | {{- end }} |
| 249 | {{- with .Values.podDnsPolicy }} |
| 250 | dnsPolicy: {{ . }} |
| 251 | {{- end }} |
| 252 | {{- with .Values.podDnsConfig }} |
| 253 | dnsConfig: |
| 254 | {{- toYaml . | nindent 8 }} |
| 255 | {{- end }} |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame] | 256 | {{- with .Values.hostAliases }} |
| 257 | hostAliases: {{ toYaml . | nindent 8 }} |
| gio | d55d03a | 2026-07-23 16:57:48 +0400 | [diff] [blame] | 258 | {{- end }} |