argocd-helm/charts/argo-cd/templates/argocd-applicationset/deployment.yaml
Le Minh Thong 04f4cb0ba1
feat(argo-cd): Update to Argo CD v2.4.0 (#1325)
* feat(argo-cd): Upgrade redis to 7.0.0

Including CVEs.

Ref: https://github.com/redis/redis/blob/7.0/00-RELEASENOTES
Signed-off-by: Mathieu Parent <math.parent@gmail.com>

* feat(argo-cd): Use upstream applicationset binary

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* feat(argo-cd): Update Argo CD to v2.4.0

Signed-off-by: thonglm2 <thonglm2@vng.com.vn>

* Specify logs RBAC enforcement config in server
Argocd v2.4 introduced logs as a new RBAC resource. We should remind user to set the flag now for an easier upgrade experience in future releases.

Signed-off-by: thonglm2 <thonglm2@vng.com.vn>

* Remove ksonnet and helm 2 support from Application and ApplicationSet CRDs
KSonnet and Helm2 support is removed in v2.4. See: https://argo-cd.readthedocs.io/en/latest/operator-manual/upgrading/2.3-2.4/#ksonnet-support-is-removed and https://argo-cd.readthedocs.io/en/latest/operator-manual/upgrading/2.3-2.4/#helm-2-support-is-removed

Signed-off-by: thonglm2 <thonglm2@vng.com.vn>

* Specify logs RBAC enforcement config in argocd-cm
Argocd v2.4 introduced logs as a new RBAC resource. We should remind user to set the flag now for an easier upgrade in future releases.

Signed-off-by: thonglm2 <thonglm2@vng.com.vn>

* Add entrypoint.sh on applicationset deployment

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

Co-authored-by: Mathieu Parent <math.parent@gmail.com>
Co-authored-by: Petr Drastil <petr.drastil@gmail.com>
Co-authored-by: thonglm2 <thonglm2@vng.com.vn>
Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2022-06-14 11:10:08 +01:00

131 lines
5.5 KiB
YAML

{{- if .Values.applicationSet.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "argo-cd.applicationSet.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" .Values.applicationSet.name) | nindent 4 }}
app.kubernetes.io/version: {{ default (include "argo-cd.defaultTag" .) .Values.applicationSet.image.tag | quote }}
spec:
replicas: {{ .Values.applicationSet.replicaCount }}
selector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.applicationSet.name) | nindent 6 }}
template:
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.applicationSet.podAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" .Values.applicationSet.name) | nindent 8 }}
app.kubernetes.io/version: {{ default (include "argo-cd.defaultTag" .) .Values.applicationSet.image.tag | quote }}
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.applicationSet.podLabels) }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.applicationSet.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "argo-cd.applicationSetServiceAccountName" . }}
securityContext:
{{- toYaml (mergeOverwrite (deepCopy .Values.global.securityContext) .Values.applicationSet.podSecurityContext) | nindent 8 }}
containers:
- name: {{ .Values.applicationSet.name }}
securityContext:
{{- toYaml .Values.applicationSet.securityContext | nindent 12 }}
command:
- entrypoint.sh
- argocd-applicationset-controller
- --metrics-addr={{ .Values.applicationSet.args.metricsAddr }}
- --probe-addr={{ .Values.applicationSet.args.probeBindAddr }}
{{- if or (gt ( .Values.applicationSet.replicaCount | int64) 1) .Values.applicationSet.args.enableLeaderElection }}
- --enable-leader-election=true
{{- end }}
- --namespace={{ .Release.Namespace }}
- --argocd-repo-server={{ template "argo-cd.repoServer.fullname" . }}:{{ .Values.repoServer.service.port }}
- --policy={{ .Values.applicationSet.args.policy }}
- --debug={{ .Values.applicationSet.args.debug }}
- --dry-run={{ .Values.applicationSet.args.dryRun }}
{{- with .Values.applicationSet.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ default .Values.global.image.repository .Values.applicationSet.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.applicationSet.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.applicationSet.image.imagePullPolicy }}
ports:
- name: http
containerPort: {{ (split ":" .Values.applicationSet.args.probeBindAddr)._1 }}
protocol: TCP
- name: metrics
containerPort: {{ (split ":" .Values.applicationSet.args.metricsAddr)._1 }}
protocol: TCP
- name: webhook
containerPort: 7000
protocol: TCP
{{- with .Values.applicationSet.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.applicationSet.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.applicationSet.resources | nindent 12 }}
volumeMounts:
- mountPath: /tmp
name: tmp-dir
{{- if .Values.configs.knownHosts }}
- mountPath: /app/config/ssh
name: ssh-known-hosts
{{- end }}
- mountPath: /app/config/tls
name: tls-certs
- mountPath: /app/config/gpg/source
name: gpg-keys
- mountPath: /app/config/gpg/keys
name: gpg-keyring
{{- with .Values.applicationSet.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.applicationSet.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- emptyDir: {}
name: tmp-dir
{{- if .Values.configs.knownHosts }}
- configMap:
name: argocd-ssh-known-hosts-cm
name: ssh-known-hosts
{{- end }}
- configMap:
name: argocd-tls-certs-cm
name: tls-certs
- configMap:
name: argocd-gpg-keys-cm
name: gpg-keys
- emptyDir: {}
name: gpg-keyring
{{- with .Values.applicationSet.extraVolumes }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.applicationSet.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.applicationSet.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.applicationSet.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.applicationSet.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
{{- end }}