22apiVersion : apps/v1
33kind : Deployment
44metadata :
5+ {{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.applicationSet.deploymentAnnotations) }}
6+ annotations :
7+ {{- range $key, $value := . }}
8+ {{ $key }}: {{ $value | quote }}
9+ {{- end }}
10+ {{- end }}
511 name : {{ include "argo-cd.applicationSet.fullname" . }}
612 labels :
713 {{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" .Values.applicationSet.name) | nindent 4 }}
814spec :
15+ {{- with include "argo-cd.strategy" (mergeOverwrite (deepCopy .Values.global.deploymentStrategy) .Values.applicationSet.deploymentStrategy) }}
16+ strategy :
17+ {{- trim . | nindent 4 }}
18+ {{- end }}
919 replicas : {{ .Values.applicationSet.replicaCount }}
20+ revisionHistoryLimit : {{ .Values.global.revisionHistoryLimit }}
1021 selector :
1122 matchLabels :
1223 {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.applicationSet.name) | nindent 6 }}
@@ -28,30 +39,45 @@ spec:
2839 imagePullSecrets :
2940 {{- toYaml . | nindent 8 }}
3041 {{- end }}
42+ {{- with .Values.global.hostAliases }}
43+ hostAliases :
44+ {{- toYaml . | nindent 8 }}
45+ {{- end }}
46+ {{- with .Values.global.securityContext }}
3147 securityContext :
32- {{- toYaml (mergeOverwrite (deepCopy .Values.global.securityContext) .Values.applicationSet.podSecurityContext) | nindent 8 }}
48+ {{- toYaml . | nindent 8 }}
49+ {{- end }}
50+ {{- with .Values.applicationSet.priorityClassName | default .Values.global.priorityClassName }}
51+ priorityClassName : {{ . }}
52+ {{- end }}
3353 serviceAccountName : {{ include "argo-cd.applicationSetServiceAccountName" . }}
3454 containers :
3555 - name : {{ .Values.applicationSet.name }}
3656 image : {{ default .Values.global.image.repository .Values.applicationSet.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.applicationSet.image.tag }}
3757 imagePullPolicy : {{ default .Values.global.image.imagePullPolicy .Values.applicationSet.image.imagePullPolicy }}
58+ {{- if not .Values.global.entrypoint.useImplicit }}
3859 command :
39- - entrypoint.sh
40- {{/* Codefresh - change argocd-applicationset-controller to applicationset-controller*/}}
41- - applicationset-controller
60+ - {{ .Values.global.entrypoint.entrypoint | quote }}
61+ {{- end }}
62+ args :
63+ - argocd-applicationset-controller
64+ - --metrics-addr=:{{ .Values.applicationSet.containerPorts.metrics }}
65+ - --probe-addr=:{{ .Values.applicationSet.containerPorts.probe }}
66+ - --webhook-addr=:{{ .Values.applicationSet.containerPorts.webhook }}
67+ {{- with .Values.applicationSet.args.policy }}
68+ - --policy={{ . }}
69+ {{- end }}
70+ {{- with .Values.applicationSet.args.dryRun }}
71+ - --dry-run={{ . }}
72+ {{- end }}
73+ {{- with .Values.applicationSet.logFormat }}
4274 - --logformat
43- - {{ default .Values.global.logging.format .Values.applicationSet.logFormat }}
75+ - {{ . }}
76+ {{- end }}
77+ {{- with .Values.applicationSet.logLevel }}
4478 - --loglevel
45- - {{ default .Values.global.logging.level .Values.applicationSet.logLevel }}
46- - --metrics-addr={{ .Values.applicationSet.args.metricsAddr }}
47- - --probe-addr={{ .Values.applicationSet.args.probeBindAddr }}
48- {{- if or (gt ( .Values.applicationSet.replicaCount | int64) 1) .Values.applicationSet.args.enableLeaderElection }}
49- - --enable-leader-election=true
79+ - {{ . }}
5080 {{- end }}
51- - --argocd-repo-server={{ template "argo-cd.repoServer.fullname" . }}:{{ .Values.repoServer.service.port }}
52- - --policy={{ .Values.applicationSet.args.policy }}
53- - --debug={{ .Values.applicationSet.args.debug }}
54- - --dry-run={{ .Values.applicationSet.args.dryRun }}
5581 {{- with .Values.applicationSet.extraArgs }}
5682 {{- toYaml . | nindent 12 }}
5783 {{- end }}
@@ -63,24 +89,104 @@ spec:
6389 valueFrom :
6490 fieldRef :
6591 fieldPath : metadata.namespace
92+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_LEADER_ELECTION
93+ valueFrom :
94+ configMapKeyRef :
95+ key : applicationsetcontroller.enable.leader.election
96+ name : argocd-cmd-params-cm
97+ optional : true
98+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_NAMESPACE
99+ valueFrom :
100+ configMapKeyRef :
101+ key : applicationsetcontroller.namespace
102+ name : argocd-cmd-params-cm
103+ optional : true
104+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_REPO_SERVER
105+ valueFrom :
106+ configMapKeyRef :
107+ key : repo.server
108+ name : argocd-cmd-params-cm
109+ optional : true
110+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_POLICY
111+ valueFrom :
112+ configMapKeyRef :
113+ key : applicationsetcontroller.policy
114+ name : argocd-cmd-params-cm
115+ optional : true
116+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_DEBUG
117+ valueFrom :
118+ configMapKeyRef :
119+ key : applicationsetcontroller.debug
120+ name : argocd-cmd-params-cm
121+ optional : true
122+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_LOGFORMAT
123+ valueFrom :
124+ configMapKeyRef :
125+ key : applicationsetcontroller.log.format
126+ name : argocd-cmd-params-cm
127+ optional : true
128+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_LOGLEVEL
129+ valueFrom :
130+ configMapKeyRef :
131+ key : applicationsetcontroller.log.level
132+ name : argocd-cmd-params-cm
133+ optional : true
134+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_DRY_RUN
135+ valueFrom :
136+ configMapKeyRef :
137+ key : applicationsetcontroller.dryrun
138+ name : argocd-cmd-params-cm
139+ optional : true
140+ - name : ARGOCD_GIT_MODULES_ENABLED
141+ valueFrom :
142+ configMapKeyRef :
143+ key : applicationsetcontroller.enable.git.submodule
144+ name : argocd-cmd-params-cm
145+ optional : true
146+ - name : ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_SYNCS
147+ valueFrom :
148+ configMapKeyRef :
149+ key : applicationsetcontroller.enable.progressive.syncs
150+ name : argocd-cmd-params-cm
151+ optional : true
66152 {{- with .Values.applicationSet.extraEnvFrom }}
67153 envFrom :
68154 {{- toYaml . | nindent 12 }}
69155 {{- end }}
70156 ports :
71157 - name : metrics
72- containerPort : {{ (split ":" .Values.applicationSet.args.metricsAddr)._1 }}
158+ containerPort : {{ .Values.applicationSet.containerPorts.metrics }}
73159 protocol : TCP
74160 - name : probe
75- containerPort : {{ (split ":" .Values.applicationSet.args.probeBindAddr)._1 }}
161+ containerPort : {{ .Values.applicationSet.containerPorts.probe }}
76162 protocol : TCP
77163 - name : webhook
78- containerPort : 7000
164+ containerPort : {{ .Values.applicationSet.containerPorts.webhook }}
79165 protocol : TCP
166+ {{- if .Values.applicationSet.livenessProbe.enabled }}
167+ livenessProbe :
168+ tcpSocket :
169+ port : probe
170+ initialDelaySeconds : {{ .Values.applicationSet.livenessProbe.initialDelaySeconds }}
171+ periodSeconds : {{ .Values.applicationSet.livenessProbe.periodSeconds }}
172+ timeoutSeconds : {{ .Values.applicationSet.livenessProbe.timeoutSeconds }}
173+ successThreshold : {{ .Values.applicationSet.livenessProbe.successThreshold }}
174+ failureThreshold : {{ .Values.applicationSet.livenessProbe.failureThreshold }}
175+ {{- end }}
176+ {{- if .Values.applicationSet.readinessProbe.enabled }}
177+ readinessProbe :
178+ tcpSocket :
179+ port : probe
180+ initialDelaySeconds : {{ .Values.applicationSet.readinessProbe.initialDelaySeconds }}
181+ periodSeconds : {{ .Values.applicationSet.readinessProbe.periodSeconds }}
182+ timeoutSeconds : {{ .Values.applicationSet.readinessProbe.timeoutSeconds }}
183+ successThreshold : {{ .Values.applicationSet.readinessProbe.successThreshold }}
184+ failureThreshold : {{ .Values.applicationSet.readinessProbe.failureThreshold }}
185+ {{- end }}
80186 resources :
81187 {{- toYaml .Values.applicationSet.resources | nindent 12 }}
82188 securityContext :
83- {{- toYaml .Values.applicationSet.securityContext | nindent 12 }}
189+ {{- toYaml .Values.applicationSet.containerSecurityContext | nindent 12 }}
84190 volumeMounts :
85191 {{- with .Values.applicationSet.extraVolumeMounts }}
86192 {{- toYaml . | nindent 12 }}
@@ -96,22 +202,34 @@ spec:
96202 - mountPath : /tmp
97203 name : tmp
98204 {{- with .Values.applicationSet.extraContainers }}
99- {{- toYaml . | nindent 8 }}
205+ {{- tpl ( toYaml .) $ | nindent 8 }}
100206 {{- end }}
101- {{- with .Values.applicationSet.nodeSelector }}
102- nodeSelector :
103- {{- toYaml . | nindent 8 }}
207+ {{- with .Values.applicationSet.initContainers }}
208+ initContainers :
209+ {{- tpl ( toYaml .) $ | nindent 6 }}
104210 {{- end }}
105- {{- with . Values.applicationSet.affinity }}
211+ {{- with include "argo-cd.affinity" (dict "context" . "component" . Values.applicationSet) }}
106212 affinity :
213+ {{- trim . | nindent 8 }}
214+ {{- end }}
215+ {{- with .Values.applicationSet.nodeSelector | default .Values.global.nodeSelector }}
216+ nodeSelector :
107217 {{- toYaml . | nindent 8 }}
108218 {{- end }}
109- {{- with .Values.applicationSet.tolerations }}
219+ {{- with .Values.applicationSet.tolerations | default .Values.global.tolerations }}
110220 tolerations :
111221 {{- toYaml . | nindent 8 }}
112222 {{- end }}
113- {{- with .Values.applicationSet.priorityClassName }}
114- priorityClassName : {{ . }}
223+ {{- with .Values.applicationSet.topologySpreadConstraints | default .Values.global.topologySpreadConstraints }}
224+ topologySpreadConstraints :
225+ {{- range $constraint := . }}
226+ - {{ toYaml $constraint | nindent 8 | trim }}
227+ {{- if not $constraint.labelSelector }}
228+ labelSelector :
229+ matchLabels :
230+ {{- include "argo-cd.selectorLabels" (dict "context" $ "name" $.Values.applicationSet.name) | nindent 12 }}
231+ {{- end }}
232+ {{- end }}
115233 {{- end }}
116234 volumes :
117235 {{- with .Values.applicationSet.extraVolumes }}
@@ -130,4 +248,9 @@ spec:
130248 emptyDir : {}
131249 - name : tmp
132250 emptyDir : {}
251+ {{- with .Values.applicationSet.dnsConfig }}
252+ dnsConfig :
253+ {{- toYaml . | nindent 8 }}
254+ {{- end }}
255+ dnsPolicy : {{ .Values.applicationSet.dnsPolicy }}
133256{{- end }}
0 commit comments