deployment.yaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {{- if .Values.createOperator }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ include "external-secrets.fullname" . }}
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels:
  8. {{- include "external-secrets.labels" . | nindent 4 }}
  9. {{- with .Values.deploymentAnnotations }}
  10. annotations:
  11. {{- toYaml . | nindent 4 }}
  12. {{- end }}
  13. spec:
  14. replicas: {{ .Values.replicaCount }}
  15. revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
  16. selector:
  17. matchLabels:
  18. {{- include "external-secrets.selectorLabels" . | nindent 6 }}
  19. template:
  20. metadata:
  21. {{- with .Values.podAnnotations }}
  22. annotations:
  23. {{- toYaml . | nindent 8 }}
  24. {{- end }}
  25. labels:
  26. {{- include "external-secrets.selectorLabels" . | nindent 8 }}
  27. {{- with .Values.podLabels }}
  28. {{- toYaml . | nindent 8 }}
  29. {{- end }}
  30. spec:
  31. {{- with .Values.imagePullSecrets }}
  32. imagePullSecrets:
  33. {{- toYaml . | nindent 8 }}
  34. {{- end }}
  35. serviceAccountName: {{ include "external-secrets.serviceAccountName" . }}
  36. automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
  37. {{- with .Values.podSecurityContext }}
  38. securityContext:
  39. {{- toYaml . | nindent 8 }}
  40. {{- end }}
  41. containers:
  42. - name: {{ .Chart.Name }}
  43. {{- with .Values.securityContext }}
  44. securityContext:
  45. {{- toYaml . | nindent 12 }}
  46. {{- end }}
  47. image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  48. imagePullPolicy: {{ .Values.image.pullPolicy }}
  49. {{- if or (.Values.leaderElect) (.Values.scopedNamespace) (.Values.processClusterStore) (.Values.processClusterExternalSecret) (.Values.concurrent) (.Values.extraArgs) }}
  50. args:
  51. {{- if .Values.leaderElect }}
  52. - --enable-leader-election=true
  53. {{- end }}
  54. {{- if .Values.scopedNamespace }}
  55. - --namespace={{ .Values.scopedNamespace }}
  56. {{- end }}
  57. {{- if and .Values.scopedNamespace .Values.scopedRBAC }}
  58. - --enable-cluster-store-reconciler=false
  59. - --enable-cluster-external-secret-reconciler=false
  60. {{- else }}
  61. {{- if not .Values.processClusterStore }}
  62. - --enable-cluster-store-reconciler=false
  63. {{- end }}
  64. {{- if not .Values.processClusterExternalSecret }}
  65. - --enable-cluster-external-secret-reconciler=false
  66. {{- end }}
  67. {{- end }}
  68. {{- if .Values.controllerClass }}
  69. - --controller-class={{ .Values.controllerClass }}
  70. {{- end }}
  71. {{- if .Values.extendedMetricLabels }}
  72. - --enable-extended-metric-labels={{ .Values.extendedMetricLabels }}
  73. {{- end }}
  74. {{- if .Values.concurrent }}
  75. - --concurrent={{ .Values.concurrent }}
  76. {{- end }}
  77. {{- range $key, $value := .Values.extraArgs }}
  78. {{- if $value }}
  79. - --{{ $key }}={{ $value }}
  80. {{- else }}
  81. - --{{ $key }}
  82. {{- end }}
  83. {{- end }}
  84. {{- end }}
  85. ports:
  86. - containerPort: {{ .Values.prometheus.service.port }}
  87. protocol: TCP
  88. name: metrics
  89. {{- with .Values.extraEnv }}
  90. env:
  91. {{- toYaml . | nindent 12 }}
  92. {{- end }}
  93. {{- with .Values.resources }}
  94. resources:
  95. {{- toYaml . | nindent 12 }}
  96. {{- end }}
  97. {{- if .Values.extraVolumeMounts }}
  98. volumeMounts:
  99. {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
  100. {{- end }}
  101. {{- if .Values.extraContainers }}
  102. {{ toYaml .Values.extraContainers | nindent 8}}
  103. {{- end }}
  104. {{- if .Values.dnsConfig }}
  105. dnsConfig:
  106. {{- toYaml .Values.dnsConfig | nindent 8 }}
  107. {{- end }}
  108. {{- if .Values.extraVolumes }}
  109. volumes:
  110. {{- toYaml .Values.extraVolumes | nindent 8 }}
  111. {{- end }}
  112. {{- with .Values.nodeSelector }}
  113. nodeSelector:
  114. {{- toYaml . | nindent 8 }}
  115. {{- end }}
  116. {{- with .Values.affinity }}
  117. affinity:
  118. {{- toYaml . | nindent 8 }}
  119. {{- end }}
  120. {{- with .Values.tolerations }}
  121. tolerations:
  122. {{- toYaml . | nindent 8 }}
  123. {{- end }}
  124. {{- with .Values.topologySpreadConstraints }}
  125. topologySpreadConstraints:
  126. {{- toYaml . | nindent 8 }}
  127. {{- end }}
  128. {{- if .Values.priorityClassName }}
  129. priorityClassName: {{ .Values.priorityClassName }}
  130. {{- end }}
  131. {{- end }}