cert-controller-deployment.yaml 4.3 KB

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