cert-controller-deployment.yaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. containers:
  42. - name: cert-controller
  43. {{- with .Values.certController.securityContext }}
  44. securityContext:
  45. {{- toYaml . | nindent 12 }}
  46. {{- end }}
  47. image: "{{ .Values.certController.image.repository }}:{{ .Values.certController.image.tag | default .Chart.AppVersion }}"
  48. imagePullPolicy: {{ .Values.certController.image.pullPolicy }}
  49. args:
  50. - certcontroller
  51. - --crd-requeue-interval={{ .Values.certController.requeueInterval }}
  52. - --service-name={{ include "external-secrets.fullname" . }}-webhook
  53. - --service-namespace={{ .Release.Namespace }}
  54. - --secret-name={{ include "external-secrets.fullname" . }}-webhook
  55. - --secret-namespace={{ .Release.Namespace }}
  56. {{ if not .Values.crds.createClusterSecretStore -}}
  57. - --crd-names=externalsecrets.external-secrets.io
  58. - --crd-names=secretstores.external-secrets.io
  59. {{- end -}}
  60. {{- range $key, $value := .Values.certController.extraArgs }}
  61. {{- if $value }}
  62. - --{{ $key }}={{ $value }}
  63. {{- else }}
  64. - --{{ $key }}
  65. {{- end }}
  66. {{- end }}
  67. ports:
  68. - containerPort: {{ .Values.certController.prometheus.service.port }}
  69. protocol: TCP
  70. name: metrics
  71. readinessProbe:
  72. httpGet:
  73. port: 8081
  74. path: /readyz
  75. initialDelaySeconds: 20
  76. periodSeconds: 5
  77. {{- with .Values.certController.extraEnv }}
  78. env:
  79. {{- toYaml . | nindent 12 }}
  80. {{- end }}
  81. {{- with .Values.certController.resources }}
  82. resources:
  83. {{- toYaml . | nindent 12 }}
  84. {{- end }}
  85. {{- if .Values.certController.extraVolumeMounts }}
  86. volumeMounts:
  87. {{- toYaml .Values.certController.extraVolumeMounts | nindent 12 }}
  88. {{- end }}
  89. {{- if .Values.certController.extraVolumes }}
  90. volumes:
  91. {{- toYaml .Values.certController.extraVolumes | nindent 8 }}
  92. {{- end }}
  93. {{- with .Values.certController.nodeSelector }}
  94. nodeSelector:
  95. {{- toYaml . | nindent 8 }}
  96. {{- end }}
  97. {{- with .Values.certController.affinity }}
  98. affinity:
  99. {{- toYaml . | nindent 8 }}
  100. {{- end }}
  101. {{- with .Values.certController.tolerations }}
  102. tolerations:
  103. {{- toYaml . | nindent 8 }}
  104. {{- end }}
  105. {{- if .Values.certController.priorityClassName }}
  106. priorityClassName: {{ .Values.certController.priorityClassName }}
  107. {{- end }}
  108. {{- end }}