deployment.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. {{- with .Values.podSecurityContext }}
  36. securityContext:
  37. {{- toYaml . | nindent 8 }}
  38. {{- end }}
  39. containers:
  40. - name: {{ .Chart.Name }}
  41. {{- with .Values.securityContext }}
  42. securityContext:
  43. {{- toYaml . | nindent 12 }}
  44. {{- end }}
  45. image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  46. imagePullPolicy: {{ .Values.image.pullPolicy }}
  47. {{- if or (.Values.leaderElect) (.Values.scopedNamespace) (.Values.processClusterStore) (.Values.processClusterExternalSecret) (.Values.concurrent) (.Values.extraArgs) }}
  48. args:
  49. {{- if .Values.leaderElect }}
  50. - --enable-leader-election=true
  51. {{- end }}
  52. {{- if .Values.scopedNamespace }}
  53. - --namespace={{ .Values.scopedNamespace }}
  54. {{- end }}
  55. {{- if and .Values.scopedNamespace .Values.scopedRBAC }}
  56. - --enable-cluster-store-reconciler=false
  57. - --enable-cluster-external-secret-reconciler=false
  58. {{- else }}
  59. {{- if not .Values.processClusterStore }}
  60. - --enable-cluster-store-reconciler=false
  61. {{- end }}
  62. {{- if not .Values.processClusterExternalSecret }}
  63. - --enable-cluster-external-secret-reconciler=false
  64. {{- end }}
  65. {{- end }}
  66. {{- if .Values.controllerClass }}
  67. - --controller-class={{ .Values.controllerClass }}
  68. {{- end }}
  69. {{- if .Values.concurrent }}
  70. - --concurrent={{ .Values.concurrent }}
  71. {{- end }}
  72. {{- if .Values.enableAWSSession }}
  73. - --experimental-enable-aws-session-cache={{ .Values.enableAWSSession }}
  74. {{- end }}
  75. {{- range $key, $value := .Values.extraArgs }}
  76. {{- if $value }}
  77. - --{{ $key }}={{ $value }}
  78. {{- else }}
  79. - --{{ $key }}
  80. {{- end }}
  81. {{- end }}
  82. {{- end }}
  83. ports:
  84. - containerPort: {{ .Values.prometheus.service.port }}
  85. protocol: TCP
  86. name: metrics
  87. {{- with .Values.extraEnv }}
  88. env:
  89. {{- toYaml . | nindent 12 }}
  90. {{- end }}
  91. {{- with .Values.resources }}
  92. resources:
  93. {{- toYaml . | nindent 12 }}
  94. {{- end }}
  95. {{- with .Values.nodeSelector }}
  96. nodeSelector:
  97. {{- toYaml . | nindent 8 }}
  98. {{- end }}
  99. {{- with .Values.affinity }}
  100. affinity:
  101. {{- toYaml . | nindent 8 }}
  102. {{- end }}
  103. {{- with .Values.tolerations }}
  104. tolerations:
  105. {{- toYaml . | nindent 8 }}
  106. {{- end }}
  107. {{- if .Values.priorityClassName }}
  108. priorityClassName: {{ .Values.priorityClassName }}
  109. {{- end }}
  110. {{- end }}