cert-controller-deployment.yaml 4.0 KB

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