blob: b1af92799a845d7ff10340aeb7c82def50fb1360 [file] [log] [blame]
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +04001apiVersion: apps/v1
2kind: Deployment
3metadata:
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 }}
16spec:
17 replicas: {{ .Values.replicaCount }}
gio33d62932026-07-23 16:39:35 +040018 {{- /* 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 Lekveishvilid1234c12023-06-19 10:37:06 +040022 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 }}
gio33d62932026-07-23 16:39:35 +040046 {{- if and .Values.prometheus.enabled (not (or .Values.prometheus.servicemonitor.enabled .Values.prometheus.podmonitor.enabled)) }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040047 {{- 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:
gio33d62932026-07-23 16:39:35 +040055 {{- if not .Values.serviceAccount.create }}
56 {{- with .Values.global.imagePullSecrets }}
57 imagePullSecrets:
58 {{- toYaml . | nindent 8 }}
59 {{- end }}
60 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040061 serviceAccountName: {{ template "cert-manager.serviceAccountName" . }}
62 {{- if hasKey .Values "automountServiceAccountToken" }}
63 automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
64 {{- end }}
gio33d62932026-07-23 16:39:35 +040065 enableServiceLinks: {{ .Values.enableServiceLinks }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040066 {{- with .Values.global.priorityClassName }}
67 priorityClassName: {{ . | quote }}
68 {{- end }}
69 {{- with .Values.securityContext }}
70 securityContext:
71 {{- toYaml . | nindent 8 }}
72 {{- end }}
gio33d62932026-07-23 16:39:35 +040073 {{- if or .Values.volumes .Values.config}}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040074 volumes:
gio33d62932026-07-23 16:39:35 +040075 {{- if .Values.config }}
76 - name: config
77 configMap:
78 name: {{ include "cert-manager.fullname" . }}
79 {{- end }}
80 {{ with .Values.volumes }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040081 {{- toYaml . | nindent 8 }}
gio33d62932026-07-23 16:39:35 +040082 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040083 {{- end }}
84 containers:
85 - name: {{ .Chart.Name }}-controller
gio33d62932026-07-23 16:39:35 +040086 image: "{{ template "image" (tuple .Values.image $.Chart.AppVersion) }}"
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040087 imagePullPolicy: {{ .Values.image.pullPolicy }}
88 args:
gio33d62932026-07-23 16:39:35 +040089 {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}}
90 {{- if not (has (quote .Values.global.logLevel) (list "" (quote ""))) }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040091 - --v={{ .Values.global.logLevel }}
92 {{- end }}
gio33d62932026-07-23 16:39:35 +040093 {{- if .Values.config }}
94 - --config=/var/cert-manager/config/config.yaml
95 {{- end }}
96 {{- $config := default .Values.config "" }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +040097 {{- if .Values.clusterResourceNamespace }}
98 - --cluster-resource-namespace={{ .Values.clusterResourceNamespace }}
99 {{- else }}
100 - --cluster-resource-namespace=$(POD_NAMESPACE)
101 {{- end }}
102 {{- with .Values.global.leaderElection }}
103 - --leader-election-namespace={{ .namespace }}
104 {{- if .leaseDuration }}
105 - --leader-election-lease-duration={{ .leaseDuration }}
106 {{- end }}
107 {{- if .renewDeadline }}
108 - --leader-election-renew-deadline={{ .renewDeadline }}
109 {{- end }}
110 {{- if .retryPeriod }}
111 - --leader-election-retry-period={{ .retryPeriod }}
112 {{- end }}
113 {{- end }}
114 {{- with .Values.acmesolver.image }}
115 - --acme-http01-solver-image={{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}
116 {{- end }}
117 {{- with .Values.extraArgs }}
118 {{- toYaml . | nindent 10 }}
119 {{- end }}
120 {{- with .Values.ingressShim }}
121 {{- if .defaultIssuerName }}
122 - --default-issuer-name={{ .defaultIssuerName }}
123 {{- end }}
124 {{- if .defaultIssuerKind }}
125 - --default-issuer-kind={{ .defaultIssuerKind }}
126 {{- end }}
127 {{- if .defaultIssuerGroup }}
128 - --default-issuer-group={{ .defaultIssuerGroup }}
129 {{- end }}
130 {{- end }}
131 {{- if .Values.featureGates }}
132 - --feature-gates={{ .Values.featureGates }}
133 {{- end }}
134 {{- if .Values.maxConcurrentChallenges }}
135 - --max-concurrent-challenges={{ .Values.maxConcurrentChallenges }}
136 {{- end }}
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +0400137 {{- if .Values.enableCertificateOwnerRef }}
138 - --enable-certificate-owner-ref=true
139 {{- end }}
140 {{- if .Values.dns01RecursiveNameserversOnly }}
141 - --dns01-recursive-nameservers-only=true
142 {{- end }}
143 {{- with .Values.dns01RecursiveNameservers }}
144 - --dns01-recursive-nameservers={{ . }}
145 {{- end }}
gio33d62932026-07-23 16:39:35 +0400146 {{- if .Values.disableAutoApproval }}
147 - --controllers=-certificaterequests-approver
148 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +0400149 ports:
150 - containerPort: 9402
151 name: http-metrics
152 protocol: TCP
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +0400153 - containerPort: 9403
154 name: http-healthz
155 protocol: TCP
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +0400156 {{- with .Values.containerSecurityContext }}
157 securityContext:
158 {{- toYaml . | nindent 12 }}
159 {{- end }}
gio33d62932026-07-23 16:39:35 +0400160 {{- if or .Values.config .Values.volumeMounts }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +0400161 volumeMounts:
gio33d62932026-07-23 16:39:35 +0400162 {{- if .Values.config }}
163 - name: config
164 mountPath: /var/cert-manager/config
165 {{- end }}
166 {{- with .Values.volumeMounts }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +0400167 {{- toYaml . | nindent 12 }}
gio33d62932026-07-23 16:39:35 +0400168 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +0400169 {{- end }}
170 env:
171 - name: POD_NAMESPACE
172 valueFrom:
173 fieldRef:
174 fieldPath: metadata.namespace
175 {{- with .Values.extraEnv }}
176 {{- toYaml . | nindent 10 }}
177 {{- end }}
178 {{- with .Values.http_proxy }}
179 - name: HTTP_PROXY
180 value: {{ . }}
181 {{- end }}
182 {{- with .Values.https_proxy }}
183 - name: HTTPS_PROXY
184 value: {{ . }}
185 {{- end }}
186 {{- with .Values.no_proxy }}
187 - name: NO_PROXY
188 value: {{ . }}
189 {{- end }}
190 {{- with .Values.resources }}
191 resources:
192 {{- toYaml . | nindent 12 }}
193 {{- end }}
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +0400194
195 {{- with .Values.livenessProbe }}
196 {{- if .enabled }}
197 # LivenessProbe settings are based on those used for the Kubernetes
198 # controller-manager. See:
199 # https://github.com/kubernetes/kubernetes/blob/806b30170c61a38fedd54cc9ede4cd6275a1ad3b/cmd/kubeadm/app/util/staticpod/utils.go#L241-L245
200 livenessProbe:
201 httpGet:
202 port: http-healthz
203 path: /livez
204 scheme: HTTP
205 initialDelaySeconds: {{ .initialDelaySeconds }}
206 periodSeconds: {{ .periodSeconds }}
207 timeoutSeconds: {{ .timeoutSeconds }}
208 successThreshold: {{ .successThreshold }}
209 failureThreshold: {{ .failureThreshold }}
210 {{- end }}
211 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +0400212 {{- with .Values.nodeSelector }}
213 nodeSelector:
giob6e9f2f2026-07-23 16:53:10 +0400214 {{- range $key, $value := . }}
215 {{ $key }}: {{ $value | quote }}
216 {{- end }}
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +0400217 {{- end }}
218 {{- with .Values.affinity }}
219 affinity:
220 {{- toYaml . | nindent 8 }}
221 {{- end }}
222 {{- with .Values.tolerations }}
223 tolerations:
224 {{- toYaml . | nindent 8 }}
225 {{- end }}
226 {{- with .Values.topologySpreadConstraints }}
227 topologySpreadConstraints:
228 {{- toYaml . | nindent 8 }}
229 {{- end }}
230 {{- with .Values.podDnsPolicy }}
231 dnsPolicy: {{ . }}
232 {{- end }}
233 {{- with .Values.podDnsConfig }}
234 dnsConfig:
235 {{- toYaml . | nindent 8 }}
236 {{- end }}
gio33d62932026-07-23 16:39:35 +0400237 {{- with .Values.hostAliases }}
238 hostAliases: {{ toYaml . | nindent 8 }}
239 {{- end }}