blob: 6e74f1e825a01ab0a69f31f1b8f0cc83f4b1238e [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 }}
18 selector:
19 matchLabels:
20 app.kubernetes.io/name: {{ template "cert-manager.name" . }}
21 app.kubernetes.io/instance: {{ .Release.Name }}
22 app.kubernetes.io/component: "controller"
23 {{- with .Values.strategy }}
24 strategy:
25 {{- toYaml . | nindent 4 }}
26 {{- end }}
27 template:
28 metadata:
29 labels:
30 app: {{ template "cert-manager.name" . }}
31 app.kubernetes.io/name: {{ template "cert-manager.name" . }}
32 app.kubernetes.io/instance: {{ .Release.Name }}
33 app.kubernetes.io/component: "controller"
34 {{- include "labels" . | nindent 8 }}
35 {{- with .Values.podLabels }}
36 {{- toYaml . | nindent 8 }}
37 {{- end }}
38 {{- with .Values.podAnnotations }}
39 annotations:
40 {{- toYaml . | nindent 8 }}
41 {{- end }}
42 {{- if and .Values.prometheus.enabled (not .Values.prometheus.servicemonitor.enabled) }}
43 {{- if not .Values.podAnnotations }}
44 annotations:
45 {{- end }}
46 prometheus.io/path: "/metrics"
47 prometheus.io/scrape: 'true'
48 prometheus.io/port: '9402'
49 {{- end }}
50 spec:
51 serviceAccountName: {{ template "cert-manager.serviceAccountName" . }}
52 {{- if hasKey .Values "automountServiceAccountToken" }}
53 automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
54 {{- end }}
55 {{- with .Values.global.priorityClassName }}
56 priorityClassName: {{ . | quote }}
57 {{- end }}
58 {{- with .Values.securityContext }}
59 securityContext:
60 {{- toYaml . | nindent 8 }}
61 {{- end }}
62 {{- with .Values.volumes }}
63 volumes:
64 {{- toYaml . | nindent 8 }}
65 {{- end }}
66 containers:
67 - name: {{ .Chart.Name }}-controller
68 {{- with .Values.image }}
69 image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
70 {{- end }}
71 imagePullPolicy: {{ .Values.image.pullPolicy }}
72 args:
73 {{- if .Values.global.logLevel }}
74 - --v={{ .Values.global.logLevel }}
75 {{- end }}
76 {{- if .Values.clusterResourceNamespace }}
77 - --cluster-resource-namespace={{ .Values.clusterResourceNamespace }}
78 {{- else }}
79 - --cluster-resource-namespace=$(POD_NAMESPACE)
80 {{- end }}
81 {{- with .Values.global.leaderElection }}
82 - --leader-election-namespace={{ .namespace }}
83 {{- if .leaseDuration }}
84 - --leader-election-lease-duration={{ .leaseDuration }}
85 {{- end }}
86 {{- if .renewDeadline }}
87 - --leader-election-renew-deadline={{ .renewDeadline }}
88 {{- end }}
89 {{- if .retryPeriod }}
90 - --leader-election-retry-period={{ .retryPeriod }}
91 {{- end }}
92 {{- end }}
93 {{- with .Values.acmesolver.image }}
94 - --acme-http01-solver-image={{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}
95 {{- end }}
96 {{- with .Values.extraArgs }}
97 {{- toYaml . | nindent 10 }}
98 {{- end }}
99 {{- with .Values.ingressShim }}
100 {{- if .defaultIssuerName }}
101 - --default-issuer-name={{ .defaultIssuerName }}
102 {{- end }}
103 {{- if .defaultIssuerKind }}
104 - --default-issuer-kind={{ .defaultIssuerKind }}
105 {{- end }}
106 {{- if .defaultIssuerGroup }}
107 - --default-issuer-group={{ .defaultIssuerGroup }}
108 {{- end }}
109 {{- end }}
110 {{- if .Values.featureGates }}
111 - --feature-gates={{ .Values.featureGates }}
112 {{- end }}
113 {{- if .Values.maxConcurrentChallenges }}
114 - --max-concurrent-challenges={{ .Values.maxConcurrentChallenges }}
115 {{- end }}
116 ports:
117 - containerPort: 9402
118 name: http-metrics
119 protocol: TCP
120 {{- with .Values.containerSecurityContext }}
121 securityContext:
122 {{- toYaml . | nindent 12 }}
123 {{- end }}
124 {{- with .Values.volumeMounts }}
125 volumeMounts:
126 {{- toYaml . | nindent 12 }}
127 {{- end }}
128 env:
129 - name: POD_NAMESPACE
130 valueFrom:
131 fieldRef:
132 fieldPath: metadata.namespace
133 {{- with .Values.extraEnv }}
134 {{- toYaml . | nindent 10 }}
135 {{- end }}
136 {{- with .Values.http_proxy }}
137 - name: HTTP_PROXY
138 value: {{ . }}
139 {{- end }}
140 {{- with .Values.https_proxy }}
141 - name: HTTPS_PROXY
142 value: {{ . }}
143 {{- end }}
144 {{- with .Values.no_proxy }}
145 - name: NO_PROXY
146 value: {{ . }}
147 {{- end }}
148 {{- with .Values.resources }}
149 resources:
150 {{- toYaml . | nindent 12 }}
151 {{- end }}
152 {{- with .Values.nodeSelector }}
153 nodeSelector:
154 {{- toYaml . | nindent 8 }}
155 {{- end }}
156 {{- with .Values.affinity }}
157 affinity:
158 {{- toYaml . | nindent 8 }}
159 {{- end }}
160 {{- with .Values.tolerations }}
161 tolerations:
162 {{- toYaml . | nindent 8 }}
163 {{- end }}
164 {{- with .Values.topologySpreadConstraints }}
165 topologySpreadConstraints:
166 {{- toYaml . | nindent 8 }}
167 {{- end }}
168 {{- with .Values.podDnsPolicy }}
169 dnsPolicy: {{ . }}
170 {{- end }}
171 {{- with .Values.podDnsConfig }}
172 dnsConfig:
173 {{- toYaml . | nindent 8 }}
174 {{- end }}