github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/argo-cd/templates/argocd-application-controller/statefulset.yaml (about) 1 apiVersion: apps/v1 2 kind: StatefulSet 3 metadata: 4 {{- with (mergeOverwrite (deepCopy .Values.global.statefulsetAnnotations) .Values.controller.statefulsetAnnotations) }} 5 annotations: 6 {{- range $key, $value := . }} 7 {{ $key }}: {{ $value | quote }} 8 {{- end }} 9 {{- end }} 10 name: {{ template "argo-cd.controller.fullname" . }} 11 namespace: {{ .Release.Namespace | quote }} 12 labels: 13 {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} 14 spec: 15 replicas: {{ .Values.controller.replicas }} 16 # TODO: Remove for breaking release as history limit cannot be patched 17 revisionHistoryLimit: 5 18 serviceName: {{ include "argo-cd.controller.fullname" . }} 19 selector: 20 matchLabels: 21 {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }} 22 template: 23 metadata: 24 annotations: 25 checksum/cmd-params: {{ include (print $.Template.BasePath "/argocd-configs/argocd-cmd-params-cm.yaml") . | sha256sum }} 26 {{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.controller.podAnnotations) }} 27 {{- range $key, $value := . }} 28 {{ $key }}: {{ $value | quote }} 29 {{- end }} 30 {{- end }} 31 labels: 32 {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 8 }} 33 {{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.controller.podLabels) }} 34 {{- toYaml . | nindent 8 }} 35 {{- end }} 36 spec: 37 {{- with .Values.controller.imagePullSecrets | default .Values.global.imagePullSecrets }} 38 imagePullSecrets: 39 {{- toYaml . | nindent 8 }} 40 {{- end }} 41 {{- with .Values.global.hostAliases }} 42 hostAliases: 43 {{- toYaml . | nindent 8 }} 44 {{- end }} 45 {{- with .Values.global.securityContext }} 46 securityContext: 47 {{- toYaml . | nindent 8 }} 48 {{- end }} 49 {{- with .Values.controller.priorityClassName | default .Values.global.priorityClassName }} 50 priorityClassName: {{ . }} 51 {{- end }} 52 serviceAccountName: {{ include "argo-cd.controllerServiceAccountName" . }} 53 containers: 54 - args: 55 - /usr/local/bin/argocd-application-controller 56 - --metrics-port={{ .Values.controller.containerPorts.metrics }} 57 {{- if .Values.controller.metrics.applicationLabels.enabled }} 58 {{- range .Values.controller.metrics.applicationLabels.labels }} 59 - --metrics-application-labels 60 - {{ . }} 61 {{- end }} 62 {{- end }} 63 {{- with .Values.controller.args.statusProcessors }} 64 - --status-processors 65 - {{ . | quote }} 66 {{- end }} 67 {{- with .Values.controller.args.operationProcessors }} 68 - --operation-processors 69 - {{ . | quote }} 70 {{- end }} 71 {{- with .Values.controller.args.appResyncPeriod }} 72 - --app-resync 73 - {{ . | quote }} 74 {{- end }} 75 {{- with .Values.controller.args.appHardResyncPeriod }} 76 - --app-hard-resync 77 - {{ . | quote }} 78 {{- end }} 79 {{- with .Values.controller.args.selfHealTimeout }} 80 - --self-heal-timeout-seconds 81 - {{ . | quote }} 82 {{- end }} 83 {{- with .Values.controller.args.repoServerTimeoutSeconds }} 84 - --repo-server-timeout-seconds 85 - {{ . | quote }} 86 {{- end }} 87 {{- with .Values.controller.logFormat }} 88 - --logformat 89 - {{ . | quote }} 90 {{- end }} 91 {{- with .Values.controller.logLevel }} 92 - --loglevel 93 - {{ . | quote }} 94 {{- end }} 95 {{- with .Values.controller.extraArgs }} 96 {{- toYaml . | nindent 8 }} 97 {{- end }} 98 image: {{ default .Values.global.image.repository .Values.controller.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.controller.image.tag }} 99 imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.controller.image.imagePullPolicy }} 100 name: {{ .Values.controller.name }} 101 env: 102 {{- with (concat .Values.global.env .Values.controller.env) }} 103 {{- toYaml . | nindent 10 }} 104 {{- end }} 105 - name: ARGOCD_CONTROLLER_REPLICAS 106 value: {{ .Values.controller.replicas | quote }} 107 - name: ARGOCD_RECONCILIATION_TIMEOUT 108 valueFrom: 109 configMapKeyRef: 110 name: argocd-cm 111 key: timeout.reconciliation 112 optional: true 113 - name: ARGOCD_HARD_RECONCILIATION_TIMEOUT 114 valueFrom: 115 configMapKeyRef: 116 name: argocd-cm 117 key: timeout.hard.reconciliation 118 optional: true 119 - name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER 120 valueFrom: 121 configMapKeyRef: 122 name: argocd-cmd-params-cm 123 key: repo.server 124 optional: true 125 - name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_TIMEOUT_SECONDS 126 valueFrom: 127 configMapKeyRef: 128 name: argocd-cmd-params-cm 129 key: controller.repo.server.timeout.seconds 130 optional: true 131 - name: ARGOCD_APPLICATION_CONTROLLER_STATUS_PROCESSORS 132 valueFrom: 133 configMapKeyRef: 134 name: argocd-cmd-params-cm 135 key: controller.status.processors 136 optional: true 137 - name: ARGOCD_APPLICATION_CONTROLLER_OPERATION_PROCESSORS 138 valueFrom: 139 configMapKeyRef: 140 name: argocd-cmd-params-cm 141 key: controller.operation.processors 142 optional: true 143 - name: ARGOCD_APPLICATION_CONTROLLER_LOGFORMAT 144 valueFrom: 145 configMapKeyRef: 146 name: argocd-cmd-params-cm 147 key: controller.log.format 148 optional: true 149 - name: ARGOCD_APPLICATION_CONTROLLER_LOGLEVEL 150 valueFrom: 151 configMapKeyRef: 152 name: argocd-cmd-params-cm 153 key: controller.log.level 154 optional: true 155 - name: ARGOCD_APPLICATION_CONTROLLER_METRICS_CACHE_EXPIRATION 156 valueFrom: 157 configMapKeyRef: 158 name: argocd-cmd-params-cm 159 key: controller.metrics.cache.expiration 160 optional: true 161 - name: ARGOCD_APPLICATION_CONTROLLER_SELF_HEAL_TIMEOUT_SECONDS 162 valueFrom: 163 configMapKeyRef: 164 name: argocd-cmd-params-cm 165 key: controller.self.heal.timeout.seconds 166 optional: true 167 - name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_PLAINTEXT 168 valueFrom: 169 configMapKeyRef: 170 name: argocd-cmd-params-cm 171 key: controller.repo.server.plaintext 172 optional: true 173 - name: ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_STRICT_TLS 174 valueFrom: 175 configMapKeyRef: 176 name: argocd-cmd-params-cm 177 key: controller.repo.server.strict.tls 178 optional: true 179 - name: ARGOCD_APPLICATION_CONTROLLER_PERSIST_RESOURCE_HEALTH 180 valueFrom: 181 configMapKeyRef: 182 name: argocd-cmd-params-cm 183 key: controller.resource.health.persist 184 optional: true 185 - name: ARGOCD_APP_STATE_CACHE_EXPIRATION 186 valueFrom: 187 configMapKeyRef: 188 name: argocd-cmd-params-cm 189 key: controller.app.state.cache.expiration 190 optional: true 191 - name: REDIS_SERVER 192 valueFrom: 193 configMapKeyRef: 194 name: argocd-cmd-params-cm 195 key: redis.server 196 optional: true 197 - name: REDIS_COMPRESSION 198 valueFrom: 199 configMapKeyRef: 200 name: argocd-cmd-params-cm 201 key: redis.compression 202 optional: true 203 - name: REDISDB 204 valueFrom: 205 configMapKeyRef: 206 name: argocd-cmd-params-cm 207 key: redis.db 208 optional: true 209 - name: REDIS_USERNAME 210 valueFrom: 211 secretKeyRef: 212 name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }} 213 key: redis-username 214 optional: true 215 - name: REDIS_PASSWORD 216 valueFrom: 217 secretKeyRef: 218 name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }} 219 key: redis-password 220 optional: true 221 - name: ARGOCD_DEFAULT_CACHE_EXPIRATION 222 valueFrom: 223 configMapKeyRef: 224 name: argocd-cmd-params-cm 225 key: controller.default.cache.expiration 226 optional: true 227 - name: ARGOCD_APPLICATION_CONTROLLER_OTLP_ADDRESS 228 valueFrom: 229 configMapKeyRef: 230 name: argocd-cmd-params-cm 231 key: otlp.address 232 optional: true 233 - name: ARGOCD_APPLICATION_NAMESPACES 234 valueFrom: 235 configMapKeyRef: 236 name: argocd-cmd-params-cm 237 key: application.namespaces 238 optional: true 239 - name: ARGOCD_CONTROLLER_SHARDING_ALGORITHM 240 valueFrom: 241 configMapKeyRef: 242 name: argocd-cmd-params-cm 243 key: controller.sharding.algorithm 244 optional: true 245 - name: ARGOCD_APPLICATION_CONTROLLER_KUBECTL_PARALLELISM_LIMIT 246 valueFrom: 247 configMapKeyRef: 248 name: argocd-cmd-params-cm 249 key: controller.kubectl.parallelism.limit 250 optional: true 251 {{- with .Values.controller.envFrom }} 252 envFrom: 253 {{- toYaml . | nindent 10 }} 254 {{- end }} 255 ports: 256 - name: metrics 257 containerPort: {{ .Values.controller.containerPorts.metrics }} 258 protocol: TCP 259 readinessProbe: 260 httpGet: 261 path: /healthz 262 port: metrics 263 initialDelaySeconds: {{ .Values.controller.readinessProbe.initialDelaySeconds }} 264 periodSeconds: {{ .Values.controller.readinessProbe.periodSeconds }} 265 timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }} 266 successThreshold: {{ .Values.controller.readinessProbe.successThreshold }} 267 failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }} 268 resources: 269 {{- toYaml .Values.controller.resources | nindent 10 }} 270 {{- with .Values.controller.containerSecurityContext }} 271 securityContext: 272 {{- toYaml . | nindent 10 }} 273 {{- end }} 274 workingDir: /home/argocd 275 volumeMounts: 276 {{- with .Values.controller.volumeMounts }} 277 {{- toYaml . | nindent 8 }} 278 {{- end }} 279 - mountPath: /app/config/controller/tls 280 name: argocd-repo-server-tls 281 - mountPath: /home/argocd 282 name: argocd-home 283 {{- with .Values.controller.extraContainers }} 284 {{- tpl (toYaml .) $ | nindent 6 }} 285 {{- end }} 286 {{- with .Values.controller.initContainers }} 287 initContainers: 288 {{- tpl (toYaml .) $ | nindent 6 }} 289 {{- end }} 290 {{- with include "argo-cd.affinity" (dict "context" . "component" .Values.controller) }} 291 affinity: 292 {{- trim . | nindent 8 }} 293 {{- end }} 294 {{- with .Values.controller.nodeSelector | default .Values.global.nodeSelector }} 295 nodeSelector: 296 {{- toYaml . | nindent 8 }} 297 {{- end }} 298 {{- with .Values.controller.tolerations | default .Values.global.tolerations }} 299 tolerations: 300 {{- toYaml . | nindent 8 }} 301 {{- end }} 302 {{- with .Values.controller.topologySpreadConstraints | default .Values.global.topologySpreadConstraints }} 303 topologySpreadConstraints: 304 {{- range $constraint := . }} 305 - {{ toYaml $constraint | nindent 8 | trim }} 306 {{- if not $constraint.labelSelector }} 307 labelSelector: 308 matchLabels: 309 {{- include "argo-cd.selectorLabels" (dict "context" $ "name" $.Values.controller.name) | nindent 12 }} 310 {{- end }} 311 {{- end }} 312 {{- end }} 313 volumes: 314 {{- with .Values.controller.volumes }} 315 {{- toYaml . | nindent 6 }} 316 {{- end }} 317 - name: argocd-home 318 emptyDir: {} 319 - name: argocd-repo-server-tls 320 secret: 321 secretName: argocd-repo-server-tls 322 optional: true 323 items: 324 - key: tls.crt 325 path: tls.crt 326 - key: tls.key 327 path: tls.key 328 - key: ca.crt 329 path: ca.crt 330 {{- if .Values.controller.hostNetwork }} 331 hostNetwork: {{ .Values.controller.hostNetwork }} 332 {{- end }} 333 {{- with .Values.controller.dnsConfig }} 334 dnsConfig: 335 {{- toYaml . | nindent 8 }} 336 {{- end }} 337 dnsPolicy: {{ .Values.controller.dnsPolicy }}