| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- {{- if and .Values.certController.create (not .Values.webhook.certManager.enabled) }}
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: {{ include "external-secrets.fullname" . }}-cert-controller
- namespace: {{ template "external-secrets.namespace" . }}
- labels:
- {{- include "external-secrets-cert-controller.labels" . | nindent 4 }}
- {{- with .Values.certController.deploymentAnnotations }}
- annotations:
- {{- toYaml . | nindent 4 }}
- {{- end }}
- spec:
- replicas: {{ .Values.certController.replicaCount }}
- revisionHistoryLimit: {{ .Values.certController.revisionHistoryLimit }}
- selector:
- matchLabels:
- {{- include "external-secrets-cert-controller.selectorLabels" . | nindent 6 }}
- {{- with .Values.certController.strategy }}
- strategy:
- {{- toYaml . | nindent 4 }}
- {{- end }}
- template:
- metadata:
- {{- if .Values.certController.podAnnotations }}
- annotations:
- {{- toYaml .Values.certController.podAnnotations | nindent 8 }}
- {{- else if .Values.global.podAnnotations }}
- annotations:
- {{- toYaml .Values.global.podAnnotations | nindent 8 }}
- {{- end }}
- labels:
- {{- include "external-secrets-cert-controller.labels" . | nindent 8 }}
- {{- if .Values.certController.podLabels }}
- {{- toYaml .Values.certController.podLabels | nindent 8 }}
- {{- else if .Values.global.podLabels }}
- {{- toYaml .Values.global.podLabels | nindent 8 }}
- {{- end }}
- spec:
- {{- if .Values.certController.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml .Values.certController.imagePullSecrets | nindent 8 }}
- {{- else if .Values.global.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml .Values.global.imagePullSecrets | nindent 8 }}
- {{- end }}
- serviceAccountName: {{ include "external-secrets-cert-controller.serviceAccountName" . }}
- automountServiceAccountToken: {{ .Values.certController.serviceAccount.automount }}
- {{- if (semverCompare ">= 1.33-0" .Capabilities.KubeVersion.Version) }}
- {{- if kindIs "bool" .Values.certController.hostUsers }}
- hostUsers: {{ .Values.certController.hostUsers }}
- {{- end }}
- {{- end }}
- {{- with .Values.certController.podSecurityContext }}
- {{- if and (.enabled) (gt (keys . | len) 1) }}
- securityContext:
- {{- include "external-secrets.renderSecurityContext" (dict "securityContext" . "context" $) | nindent 8 }}
- {{- end }}
- {{- end }}
- hostNetwork: {{ .Values.certController.hostNetwork }}
- containers:
- - name: cert-controller
- {{- with .Values.certController.securityContext }}
- {{- if and (.enabled) (gt (keys . | len) 1) }}
- securityContext:
- {{- include "external-secrets.renderSecurityContext" (dict "securityContext" . "context" $) | nindent 12 }}
- {{- end }}
- {{- end }}
- image: {{ include "external-secrets.image" (dict "chartAppVersion" .Chart.AppVersion "image" .Values.certController.image "context" .) | trim }}
- imagePullPolicy: {{ .Values.certController.image.pullPolicy }}
- args:
- - certcontroller
- - --crd-requeue-interval={{ .Values.certController.requeueInterval }}
- - --service-name={{ include "external-secrets.fullname" . }}-webhook
- - --service-namespace={{ template "external-secrets.namespace" . }}
- - --secret-name={{ include "external-secrets.fullname" . }}-webhook
- - --secret-namespace={{ template "external-secrets.namespace" . }}
- - --metrics-addr=:{{ .Values.certController.metrics.listen.port }}
- - --healthz-addr={{ .Values.certController.readinessProbe.address }}:{{ .Values.certController.readinessProbe.port }}
- - --loglevel={{ .Values.certController.log.level }}
- - --zap-time-encoding={{ .Values.certController.log.timeEncoding }}
- {{- if not .Values.crds.createClusterSecretStore }}
- - --crd-names=externalsecrets.external-secrets.io
- - --crd-names=secretstores.external-secrets.io
- {{- end }}
- {{- if .Values.installCRDs }}
- - --enable-partial-cache=true
- {{- end }}
- {{- if .Values.enableHTTP2 }}
- - --enable-http2=true
- {{- end }}
- {{- range $key, $value := .Values.certController.extraArgs }}
- {{- if $value }}
- - --{{ $key }}={{ $value }}
- {{- else }}
- - --{{ $key }}
- {{- end }}
- {{- end }}
- ports:
- - containerPort: {{ .Values.certController.metrics.listen.port }}
- protocol: TCP
- name: metrics
- - containerPort: {{ .Values.certController.readinessProbe.port }}
- protocol: TCP
- name: ready
- {{- if and .Values.certController.startupProbe.enabled (not .Values.certController.startupProbe.useReadinessProbePort) }}
- - containerPort: {{ .Values.certController.startupProbe.port }}
- protocol: TCP
- name: startup
- {{- end }}
- readinessProbe:
- httpGet:
- port: ready
- path: /readyz
- initialDelaySeconds: 20
- periodSeconds: 5
- {{- if .Values.certController.startupProbe.enabled }}
- startupProbe:
- httpGet:
- {{- if .Values.certController.startupProbe.useReadinessProbePort }}
- port: ready
- {{- else }}
- port: startup
- {{- end }}
- path: /readyz
- initialDelaySeconds: 20
- periodSeconds: 5
- {{- end }}
- {{- with .Values.certController.extraEnv }}
- env:
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- with .Values.certController.resources }}
- resources:
- {{- toYaml . | nindent 12 }}
- {{- end }}
- {{- if .Values.certController.extraVolumeMounts }}
- volumeMounts:
- {{- toYaml .Values.certController.extraVolumeMounts | nindent 12 }}
- {{- end }}
- {{- with .Values.certController.extraInitContainers }}
- initContainers:
- {{- tpl (toYaml . | nindent 8) $ }}
- {{- end }}
- {{- if .Values.certController.extraVolumes }}
- volumes:
- {{- toYaml .Values.certController.extraVolumes | nindent 8 }}
- {{- end }}
- {{- with .Values.certController.nodeSelector | default .Values.global.nodeSelector }}
- nodeSelector:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.certController.affinity | default .Values.global.affinity }}
- affinity:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.certController.tolerations | default .Values.global.tolerations }}
- tolerations:
- {{- toYaml . | nindent 8 }}
- {{- end }}
- {{- with .Values.certController.topologySpreadConstraints | default .Values.global.topologySpreadConstraints }}
- topologySpreadConstraints:
- {{- range $constraint := . }}
- - {{ toYaml $constraint | nindent 10 | trim }}
- {{- if not $constraint.labelSelector }}
- labelSelector:
- matchLabels:
- {{- include "external-secrets-cert-controller.selectorLabels" $ | nindent 14 }}
- {{- end }}
- {{- end }}
- {{- end }}
- {{- if .Values.certController.priorityClassName }}
- priorityClassName: {{ .Values.certController.priorityClassName }}
- {{- end }}
- {{- end }}
|