cert-controller-deployment.yaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {{- if .Values.certController.create }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ include "external-secrets.fullname" . }}-cert-controller
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels:
  8. {{- include "external-secrets-cert-controller.labels" . | nindent 4 }}
  9. {{- with .Values.certController.deploymentAnnotations }}
  10. annotations:
  11. {{- toYaml . | nindent 4 }}
  12. {{- end }}
  13. spec:
  14. replicas: {{ .Values.certController.replicaCount }}
  15. revisionHistoryLimit: {{ .Values.certController.revisionHistoryLimit }}
  16. selector:
  17. matchLabels:
  18. {{- include "external-secrets-cert-controller.selectorLabels" . | nindent 6 }}
  19. template:
  20. metadata:
  21. {{- with .Values.certController.podAnnotations }}
  22. annotations:
  23. {{- toYaml . | nindent 8 }}
  24. {{- end }}
  25. labels:
  26. {{- include "external-secrets-cert-controller.labels" . | nindent 8 }}
  27. {{- with .Values.certController.podLabels }}
  28. {{- toYaml . | nindent 8 }}
  29. {{- end }}
  30. spec:
  31. {{- with .Values.certController.imagePullSecrets }}
  32. imagePullSecrets:
  33. {{- toYaml . | nindent 8 }}
  34. {{- end }}
  35. serviceAccountName: {{ include "external-secrets-cert-controller.serviceAccountName" . }}
  36. automountServiceAccountToken: {{ .Values.certController.serviceAccount.automount }}
  37. {{- with .Values.certController.podSecurityContext }}
  38. securityContext:
  39. {{- toYaml . | nindent 8 }}
  40. {{- end }}
  41. hostNetwork: {{ .Values.certController.hostNetwork }}
  42. containers:
  43. - name: cert-controller
  44. {{- with .Values.certController.securityContext }}
  45. securityContext:
  46. {{- toYaml . | nindent 12 }}
  47. {{- end }}
  48. image: "{{ .Values.certController.image.repository }}:{{ .Values.certController.image.tag | default .Chart.AppVersion }}"
  49. imagePullPolicy: {{ .Values.certController.image.pullPolicy }}
  50. args:
  51. - certcontroller
  52. - --crd-requeue-interval={{ .Values.certController.requeueInterval }}
  53. - --service-name={{ include "external-secrets.fullname" . }}-webhook
  54. - --service-namespace={{ .Release.Namespace }}
  55. - --secret-name={{ template "external-secrets-webhook.certSecretName" . }}
  56. - --secret-namespace={{ .Release.Namespace }}
  57. - --metrics-addr=:{{ .Values.certController.prometheus.service.port }}
  58. - --healthz-addr={{ .Values.certController.readinessProbe.address }}:{{ .Values.certController.readinessProbe.port }}
  59. - --enable-cert-renewal={{ .Values.certController.enableCertRenewal }}
  60. {{ if not .Values.crds.createClusterSecretStore -}}
  61. - --crd-names=externalsecrets.external-secrets.io
  62. - --crd-names=secretstores.external-secrets.io
  63. {{- end -}}
  64. {{- range $key, $value := .Values.certController.extraArgs }}
  65. {{- if $value }}
  66. - --{{ $key }}={{ $value }}
  67. {{- else }}
  68. - --{{ $key }}
  69. {{- end }}
  70. {{- end }}
  71. ports:
  72. - containerPort: {{ .Values.certController.prometheus.service.port }}
  73. protocol: TCP
  74. name: metrics
  75. readinessProbe:
  76. httpGet:
  77. port: {{ .Values.certController.readinessProbe.port }}
  78. path: /readyz
  79. initialDelaySeconds: 20
  80. periodSeconds: 5
  81. {{- with .Values.certController.extraEnv }}
  82. env:
  83. {{- toYaml . | nindent 12 }}
  84. {{- end }}
  85. {{- with .Values.certController.resources }}
  86. resources:
  87. {{- toYaml . | nindent 12 }}
  88. {{- end }}
  89. {{- if .Values.certController.extraVolumeMounts }}
  90. volumeMounts:
  91. {{- toYaml .Values.certController.extraVolumeMounts | nindent 12 }}
  92. {{- end }}
  93. {{- if .Values.certController.extraVolumes }}
  94. volumes:
  95. {{- toYaml .Values.certController.extraVolumes | nindent 8 }}
  96. {{- end }}
  97. {{- with .Values.certController.nodeSelector }}
  98. nodeSelector:
  99. {{- toYaml . | nindent 8 }}
  100. {{- end }}
  101. {{- with .Values.certController.affinity }}
  102. affinity:
  103. {{- toYaml . | nindent 8 }}
  104. {{- end }}
  105. {{- with .Values.certController.tolerations }}
  106. tolerations:
  107. {{- toYaml . | nindent 8 }}
  108. {{- end }}
  109. {{- with .Values.certController.topologySpreadConstraints }}
  110. topologySpreadConstraints:
  111. {{- toYaml . | nindent 8 }}
  112. {{- end }}
  113. {{- if .Values.certController.priorityClassName }}
  114. priorityClassName: {{ .Values.certController.priorityClassName }}
  115. {{- end }}
  116. {{- end }}