Skip to content

Commit 1961400

Browse files
Merge pull request #9 from codefresh-io/align-applicationset
Align applicationset with upstream and upgrade chart to 5.28.1
2 parents 30b338a + 4b11ca2 commit 1961400

File tree

29 files changed

+476
-175
lines changed

29 files changed

+476
-175
lines changed

.github/workflows/lint-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- name: Setup Chart Linting
2828
id: lint
29-
uses: helm/chart-testing-action@v2.3.1
29+
uses: helm/chart-testing-action@v2.4.0
3030
with:
3131
# Note: Also update in scripts/lint.sh
3232
version: v3.7.1

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
pull-requests: write # for actions/stale to close stale PRs
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/stale@v7
17+
- uses: actions/stale@v8
1818
with:
1919
repo-token: ${{ secrets.GITHUB_TOKEN }}
2020
# Number of days of inactivity before an issue becomes stale

charts/argo-cd/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: redis-ha
33
repository: https://dandydeveloper.github.io/charts/
4-
version: 4.22.4
5-
digest: sha256:5df60910862b364ebfb82cba2b2f0951c39ad36446647fb3f501bdeadc92fbd7
6-
generated: "2022-12-26T22:58:11.561184+09:00"
4+
version: 4.22.5
5+
digest: sha256:d2e927511e515fb862f23dd413ee3a356c855d808f6f9ad1d345ee62b8c7ea16
6+
generated: "2023-03-30T08:25:32.738257836+02:00"

charts/argo-cd/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: v2.6.0-cap-CR-17237
33
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
44
name: argo-cd
5-
version: 5.27.1-1-cap-CR-17237
5+
version: 5.28.1-1-cap-CR-17237
66
kubeVersion: ">=1.22.0-0"
77
home: https://github.com/argoproj/argo-helm
88
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
@@ -18,10 +18,10 @@ maintainers:
1818
url: https://argoproj.github.io/
1919
dependencies:
2020
- name: redis-ha
21-
version: 4.22.4
21+
version: 4.22.5
2222
repository: https://dandydeveloper.github.io/charts/
2323
condition: redis-ha.enabled
2424
annotations:
2525
artifacthub.io/changes: |
26-
- kind: changed
27-
description: Upgrade Argo CD to v2.6.6
26+
- kind: fixed
27+
description: Change default value for global.tolerations, from object to array.

charts/argo-cd/README.md

Lines changed: 55 additions & 34 deletions
Large diffs are not rendered by default.

charts/argo-cd/templates/_common.tpl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,20 @@ nodeAffinity:
120120
{{- end -}}
121121
{{- end -}}
122122
{{- end -}}
123+
124+
{{/*
125+
Common deployment strategy definition
126+
- Recreate don't have additional fields, we need to remove them if added by the mergeOverwrite
127+
*/}}
128+
{{- define "argo-cd.strategy" -}}
129+
{{- $preset := . -}}
130+
{{- if (eq $preset.type "Recreate") }}
131+
type: Recreate
132+
{{- else if (eq $preset.type "RollingUpdate") }}
133+
type: RollingUpdate
134+
{{- with $preset.rollingUpdate }}
135+
rollingUpdate:
136+
{{- toYaml . | nindent 2 }}
137+
{{- end }}
138+
{{- end }}
139+
{{- end -}}

charts/argo-cd/templates/argocd-application-controller/statefulset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ spec:
312312
path: tls.key
313313
- key: ca.crt
314314
path: ca.crt
315+
{{- if .Values.controller.hostNetwork }}
315316
hostNetwork: {{ .Values.controller.hostNetwork }}
317+
{{- end }}
316318
{{- with .Values.controller.dnsConfig }}
317319
dnsConfig:
318320
{{- toYaml . | nindent 8 }}

charts/argo-cd/templates/argocd-applicationset/deployment.yaml

Lines changed: 149 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:
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 }}
814
spec:
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 }}

charts/argo-cd/templates/argocd-notifications/deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ metadata:
1414
spec:
1515
replicas: 1
1616
revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }}
17+
{{- with include "argo-cd.strategy" (mergeOverwrite (deepCopy .Values.global.deploymentStrategy) .Values.notifications.deploymentStrategy) }}
1718
strategy:
18-
type: Recreate
19+
{{- trim . | nindent 4 }}
20+
{{- end }}
1921
selector:
2022
matchLabels:
2123
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}

charts/argo-cd/templates/argocd-repo-server/deployment.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ metadata:
1111
labels:
1212
{{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }}
1313
spec:
14+
{{- with include "argo-cd.strategy" (mergeOverwrite (deepCopy .Values.global.deploymentStrategy) .Values.repoServer.deploymentStrategy) }}
15+
strategy:
16+
{{- trim . | nindent 4 }}
17+
{{- end }}
1418
{{- if not .Values.repoServer.autoscaling.enabled }}
1519
replicas: {{ .Values.repoServer.replicas }}
1620
{{- end }}
@@ -56,8 +60,10 @@ spec:
5660
- name: {{ .Values.repoServer.name }}
5761
image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.repoServer.image.tag }}
5862
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.repoServer.image.imagePullPolicy }}
63+
{{- if not .Values.global.entrypoint.useImplicit }}
5964
command:
60-
- entrypoint.sh
65+
- {{ .Values.global.entrypoint.entrypoint | quote }}
66+
{{- end }}
6167
args:
6268
- argocd-repo-server
6369
- --port={{ .Values.repoServer.containerPorts.server }}
@@ -355,7 +361,9 @@ spec:
355361
path: tls.key
356362
- key: ca.crt
357363
path: ca.crt
364+
{{- if .Values.repoServer.hostNetwork }}
358365
hostNetwork: {{ .Values.repoServer.hostNetwork }}
366+
{{- end }}
359367
{{- with .Values.repoServer.dnsConfig }}
360368
dnsConfig:
361369
{{- toYaml . | nindent 8 }}

0 commit comments

Comments
 (0)