cert-controller-deployment.yaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {{- if and .Values.certController.create (not .Values.webhook.certManager.enabled) }}
  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={{ include "external-secrets.fullname" . }}-webhook
  56. - --secret-namespace={{ .Release.Namespace }}
  57. - --metrics-addr=:{{ .Values.certController.metrics.listen.port }}
  58. - --healthz-addr={{ .Values.certController.readinessProbe.address }}:{{ .Values.certController.readinessProbe.port }}
  59. {{ if not .Values.crds.createClusterSecretStore -}}
  60. - --crd-names=externalsecrets.external-secrets.io
  61. - --crd-names=secretstores.external-secrets.io
  62. {{- end -}}
  63. {{- range $key, $value := .Values.certController.extraArgs }}
  64. {{- if $value }}
  65. - --{{ $key }}={{ $value }}
  66. {{- else }}
  67. - --{{ $key }}
  68. {{- end }}
  69. {{- end }}
  70. ports:
  71. - containerPort: {{ .Values.certController.metrics.listen.port }}
  72. protocol: TCP
  73. name: metrics
  74. readinessProbe:
  75. httpGet:
  76. port: {{ .Values.certController.readinessProbe.port }}
  77. path: /readyz
  78. initialDelaySeconds: 20
  79. periodSeconds: 5
  80. {{- with .Values.certController.extraEnv }}
  81. env:
  82. {{- toYaml . | nindent 12 }}
  83. {{- end }}
  84. {{- with .Values.certController.resources }}
  85. resources:
  86. {{- toYaml . | nindent 12 }}
  87. {{- end }}
  88. {{- if .Values.certController.extraVolumeMounts }}
  89. volumeMounts:
  90. {{- toYaml .Values.certController.extraVolumeMounts | nindent 12 }}
  91. {{- end }}
  92. {{- if .Values.certController.extraVolumes }}
  93. volumes:
  94. {{- toYaml .Values.certController.extraVolumes | nindent 8 }}
  95. {{- end }}
  96. {{- with .Values.certController.nodeSelector }}
  97. nodeSelector:
  98. {{- toYaml . | nindent 8 }}
  99. {{- end }}
  100. {{- with .Values.certController.affinity }}
  101. affinity:
  102. {{- toYaml . | nindent 8 }}
  103. {{- end }}
  104. {{- with .Values.certController.tolerations }}
  105. tolerations:
  106. {{- toYaml . | nindent 8 }}
  107. {{- end }}
  108. {{- with .Values.certController.topologySpreadConstraints }}
  109. topologySpreadConstraints:
  110. {{- toYaml . | nindent 8 }}
  111. {{- end }}
  112. {{- if .Values.certController.priorityClassName }}
  113. priorityClassName: {{ .Values.certController.priorityClassName }}
  114. {{- end }}
  115. {{- end }}