deployment.yaml 4.1 KB

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