deployment.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.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 .Values.controllerClass }}
  56. - --controller-class={{ .Values.controllerClass }}
  57. {{- end }}
  58. {{- if .Values.concurrent }}
  59. - --concurrent={{ .Values.concurrent }}
  60. {{- end }}
  61. {{- range $key, $value := .Values.extraArgs }}
  62. {{- if $value }}
  63. - --{{ $key }}={{ $value }}
  64. {{- else }}
  65. - --{{ $key }}
  66. {{- end }}
  67. {{- end }}
  68. {{- end }}
  69. ports:
  70. - containerPort: {{ .Values.prometheus.service.port }}
  71. protocol: TCP
  72. name: metrics
  73. {{- with .Values.extraEnv }}
  74. env:
  75. {{- toYaml . | nindent 12 }}
  76. {{- end }}
  77. {{- with .Values.resources }}
  78. resources:
  79. {{- toYaml . | nindent 12 }}
  80. {{- end }}
  81. {{- with .Values.nodeSelector }}
  82. nodeSelector:
  83. {{- toYaml . | nindent 8 }}
  84. {{- end }}
  85. {{- with .Values.affinity }}
  86. affinity:
  87. {{- toYaml . | nindent 8 }}
  88. {{- end }}
  89. {{- with .Values.tolerations }}
  90. tolerations:
  91. {{- toYaml . | nindent 8 }}
  92. {{- end }}
  93. {{- if .Values.priorityClassName }}
  94. priorityClassName: {{ .Values.priorityClassName }}
  95. {{- end }}
  96. {{- end }}