deployment.yaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. hostNetwork: {{ .Values.hostNetwork }}
  42. containers:
  43. - name: {{ .Chart.Name }}
  44. {{- with .Values.securityContext }}
  45. securityContext:
  46. {{- toYaml . | nindent 12 }}
  47. {{- end }}
  48. image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  49. imagePullPolicy: {{ .Values.image.pullPolicy }}
  50. {{- if or (.Values.leaderElect) (.Values.scopedNamespace) (.Values.processClusterStore) (.Values.processClusterExternalSecret) (.Values.concurrent) (.Values.extraArgs) }}
  51. args:
  52. {{- if .Values.leaderElect }}
  53. - --enable-leader-election=true
  54. {{- end }}
  55. {{- if .Values.scopedNamespace }}
  56. - --namespace={{ .Values.scopedNamespace }}
  57. {{- end }}
  58. {{- if and .Values.scopedNamespace .Values.scopedRBAC }}
  59. - --enable-cluster-store-reconciler=false
  60. - --enable-cluster-external-secret-reconciler=false
  61. {{- else }}
  62. {{- if not .Values.processClusterStore }}
  63. - --enable-cluster-store-reconciler=false
  64. {{- end }}
  65. {{- if not .Values.processClusterExternalSecret }}
  66. - --enable-cluster-external-secret-reconciler=false
  67. {{- end }}
  68. {{- end }}
  69. {{- if .Values.controllerClass }}
  70. - --controller-class={{ .Values.controllerClass }}
  71. {{- end }}
  72. {{- if .Values.extendedMetricLabels }}
  73. - --enable-extended-metric-labels={{ .Values.extendedMetricLabels }}
  74. {{- end }}
  75. {{- if .Values.concurrent }}
  76. - --concurrent={{ .Values.concurrent }}
  77. {{- end }}
  78. {{- range $key, $value := .Values.extraArgs }}
  79. {{- if $value }}
  80. - --{{ $key }}={{ $value }}
  81. {{- else }}
  82. - --{{ $key }}
  83. {{- end }}
  84. {{- end }}
  85. {{- end }}
  86. ports:
  87. - containerPort: {{ .Values.prometheus.service.port }}
  88. protocol: TCP
  89. name: metrics
  90. {{- with .Values.extraEnv }}
  91. env:
  92. {{- toYaml . | nindent 12 }}
  93. {{- end }}
  94. {{- with .Values.resources }}
  95. resources:
  96. {{- toYaml . | nindent 12 }}
  97. {{- end }}
  98. {{- if .Values.extraVolumeMounts }}
  99. volumeMounts:
  100. {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
  101. {{- end }}
  102. {{- if .Values.extraContainers }}
  103. {{ toYaml .Values.extraContainers | nindent 8}}
  104. {{- end }}
  105. {{- if .Values.dnsConfig }}
  106. dnsConfig:
  107. {{- toYaml .Values.dnsConfig | nindent 8 }}
  108. {{- end }}
  109. {{- if .Values.extraVolumes }}
  110. volumes:
  111. {{- toYaml .Values.extraVolumes | nindent 8 }}
  112. {{- end }}
  113. {{- with .Values.nodeSelector }}
  114. nodeSelector:
  115. {{- toYaml . | nindent 8 }}
  116. {{- end }}
  117. {{- with .Values.affinity }}
  118. affinity:
  119. {{- toYaml . | nindent 8 }}
  120. {{- end }}
  121. {{- with .Values.tolerations }}
  122. tolerations:
  123. {{- toYaml . | nindent 8 }}
  124. {{- end }}
  125. {{- with .Values.topologySpreadConstraints }}
  126. topologySpreadConstraints:
  127. {{- toYaml . | nindent 8 }}
  128. {{- end }}
  129. {{- if .Values.priorityClassName }}
  130. priorityClassName: {{ .Values.priorityClassName }}
  131. {{- end }}
  132. {{- end }}