|
| 1 | +{{- if .Values.acrController.enabled }} |
| 2 | +apiVersion: apps/v1 |
| 3 | +kind: Deployment |
| 4 | +metadata: |
| 5 | + {{- with (mergeOverwrite (deepCopy .Values.global.statefulsetAnnotations) .Values.acrController.statefulsetAnnotations) }} |
| 6 | + annotations: |
| 7 | + {{- range $key, $value := . }} |
| 8 | + {{ $key }}: {{ $value | quote }} |
| 9 | + {{- end }} |
| 10 | + {{- end }} |
| 11 | + name: {{ template "argo-cd.acr-controller.fullname" . }} |
| 12 | + namespace: {{ .Release.Namespace | quote }} |
| 13 | + labels: |
| 14 | + {{- include "argo-cd.labels" (dict "context" . "component" .Values.acrController.name "name" .Values.acrController.name) | nindent 4 }} |
| 15 | +spec: |
| 16 | + replicas: {{ .Values.acrController.replicas }} |
| 17 | + # TODO: Remove for breaking release as history limit cannot be patched |
| 18 | + revisionHistoryLimit: 5 |
| 19 | + selector: |
| 20 | + matchLabels: |
| 21 | + {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.acrController.name) | nindent 6 }} |
| 22 | + template: |
| 23 | + metadata: |
| 24 | + labels: |
| 25 | + {{- include "argo-cd.labels" (dict "context" . "component" .Values.acrController.name "name" .Values.acrController.name) | nindent 8 }} |
| 26 | + {{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.acrController.podLabels) }} |
| 27 | + {{- toYaml . | nindent 8 }} |
| 28 | + {{- end }} |
| 29 | + spec: |
| 30 | + {{- with .Values.acrController.imagePullSecrets | default .Values.global.imagePullSecrets }} |
| 31 | + imagePullSecrets: |
| 32 | + {{- toYaml . | nindent 8 }} |
| 33 | + {{- end }} |
| 34 | + {{- with .Values.global.hostAliases }} |
| 35 | + hostAliases: |
| 36 | + {{- toYaml . | nindent 8 }} |
| 37 | + {{- end }} |
| 38 | + {{- with .Values.global.securityContext }} |
| 39 | + securityContext: |
| 40 | + {{- toYaml . | nindent 8 }} |
| 41 | + {{- end }} |
| 42 | + {{- with .Values.acrController.priorityClassName | default .Values.global.priorityClassName }} |
| 43 | + priorityClassName: {{ . }} |
| 44 | + {{- end }} |
| 45 | + {{- if .Values.acrController.terminationGracePeriodSeconds }} |
| 46 | + terminationGracePeriodSeconds: {{ .Values.acrController.terminationGracePeriodSeconds }} |
| 47 | + {{- end }} |
| 48 | + serviceAccountName: {{ include "argo-cd.acrControllerServiceAccountName" . }} |
| 49 | + containers: |
| 50 | + - args: |
| 51 | + - /usr/local/bin/argocd-application-change-revision-controller |
| 52 | + {{- with .Values.acrController.extraArgs }} |
| 53 | + {{- toYaml . | nindent 8 }} |
| 54 | + {{- end }} |
| 55 | + image: {{ default .Values.global.image.repository .Values.acrController.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.acrController.image.tag }} |
| 56 | + imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.acrController.image.imagePullPolicy }} |
| 57 | + name: {{ .Values.acrController.name }} |
| 58 | + env: |
| 59 | + {{- with (concat .Values.global.env .Values.acrController.env) }} |
| 60 | + {{- toYaml . | nindent 10 }} |
| 61 | + {{- end }} |
| 62 | + - name: ARGOCD_SERVER |
| 63 | + value: "http://argocd-server:80" |
| 64 | + - name: ARGOCD_TOKEN |
| 65 | + valueFrom: |
| 66 | + secretKeyRef: |
| 67 | + key: token |
| 68 | + name: argocd-token |
| 69 | + - name: ARGOCD_APPLICATION_NAMESPACES |
| 70 | + valueFrom: |
| 71 | + configMapKeyRef: |
| 72 | + name: argocd-cmd-params-cm |
| 73 | + key: application.namespaces |
| 74 | + optional: true |
| 75 | + - name: ACR_CONTROLLER_LOGFORMAT |
| 76 | + valueFrom: |
| 77 | + configMapKeyRef: |
| 78 | + name: argocd-cmd-params-cm |
| 79 | + key: acr.log.format |
| 80 | + optional: true |
| 81 | + - name: ACR_CONTROLLER_LOG_LEVEL |
| 82 | + valueFrom: |
| 83 | + configMapKeyRef: |
| 84 | + name: argocd-cmd-params-cm |
| 85 | + key: acr.log.level |
| 86 | + optional: true |
| 87 | + - name: ACR_CONTROLLER_LISTEN_ADDRESS |
| 88 | + valueFrom: |
| 89 | + configMapKeyRef: |
| 90 | + name: argocd-cmd-params-cm |
| 91 | + key: acr.listen.address |
| 92 | + optional: true |
| 93 | + {{- with .Values.acrController.envFrom }} |
| 94 | + envFrom: |
| 95 | + {{- toYaml . | nindent 10 }} |
| 96 | + {{- end }} |
| 97 | + ports: |
| 98 | + - name: health |
| 99 | + containerPort: {{ .Values.acrController.containerPorts.health }} |
| 100 | + protocol: TCP |
| 101 | + livenessProbe: |
| 102 | + httpGet: |
| 103 | + path: /healthz?full=true |
| 104 | + port: health |
| 105 | + initialDelaySeconds: 3 |
| 106 | + periodSeconds: 30 |
| 107 | + timeoutSeconds: 5 |
| 108 | + readinessProbe: |
| 109 | + httpGet: |
| 110 | + path: /healthz |
| 111 | + port: health |
| 112 | + initialDelaySeconds: {{ .Values.acrController.readinessProbe.initialDelaySeconds }} |
| 113 | + periodSeconds: {{ .Values.acrController.readinessProbe.periodSeconds }} |
| 114 | + timeoutSeconds: {{ .Values.acrController.readinessProbe.timeoutSeconds }} |
| 115 | + successThreshold: {{ .Values.acrController.readinessProbe.successThreshold }} |
| 116 | + failureThreshold: {{ .Values.acrController.readinessProbe.failureThreshold }} |
| 117 | + resources: |
| 118 | + {{- toYaml .Values.acrController.resources | nindent 12 }} |
| 119 | + {{- with .Values.acrController.containerSecurityContext }} |
| 120 | + securityContext: |
| 121 | + {{- toYaml . | nindent 10 }} |
| 122 | + {{- end }} |
| 123 | + {{- with .Values.acrController.extraContainers }} |
| 124 | + {{- tpl (toYaml .) $ | nindent 6 }} |
| 125 | + {{- end }} |
| 126 | + {{- with .Values.acrController.initContainers }} |
| 127 | + initContainers: |
| 128 | + {{- tpl (toYaml .) $ | nindent 6 }} |
| 129 | + {{- end }} |
| 130 | + {{- with include "argo-cd.affinity" (dict "context" . "component" .Values.acrController) }} |
| 131 | + affinity: |
| 132 | + {{- trim . | nindent 8 }} |
| 133 | + {{- end }} |
| 134 | + {{- with .Values.acrController.nodeSelector | default .Values.global.nodeSelector }} |
| 135 | + nodeSelector: |
| 136 | + {{- toYaml . | nindent 8 }} |
| 137 | + {{- end }} |
| 138 | + {{- with .Values.acrController.tolerations | default .Values.global.tolerations }} |
| 139 | + tolerations: |
| 140 | + {{- toYaml . | nindent 8 }} |
| 141 | + {{- end }} |
| 142 | + {{- with .Values.acrController.topologySpreadConstraints | default .Values.global.topologySpreadConstraints }} |
| 143 | + topologySpreadConstraints: |
| 144 | + {{- range $constraint := . }} |
| 145 | + - {{ toYaml $constraint | nindent 8 | trim }} |
| 146 | + {{- if not $constraint.labelSelector }} |
| 147 | + labelSelector: |
| 148 | + matchLabels: |
| 149 | + {{- include "argo-cd.selectorLabels" (dict "context" $ "name" $.Values.acrController.name) | nindent 12 }} |
| 150 | + {{- end }} |
| 151 | + {{- end }} |
| 152 | + {{- end }} |
| 153 | + {{- if .Values.acrController.hostNetwork }} |
| 154 | + hostNetwork: {{ .Values.acrController.hostNetwork }} |
| 155 | + {{- end }} |
| 156 | + {{- with .Values.acrController.dnsConfig }} |
| 157 | + dnsConfig: |
| 158 | + {{- toYaml . | nindent 8 }} |
| 159 | + {{- end }} |
| 160 | + dnsPolicy: {{ .Values.acrController.dnsPolicy }} |
| 161 | +{{- end }} |
0 commit comments