deployment.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ include "external-secrets.fullname" . }}
  5. namespace: {{ .Release.Namespace | quote }}
  6. labels:
  7. {{- include "external-secrets.labels" . | nindent 4 }}
  8. {{- with .Values.deploymentAnnotations }}
  9. annotations:
  10. {{- toYaml . | nindent 4 }}
  11. {{- end }}
  12. spec:
  13. replicas: {{ .Values.replicaCount }}
  14. selector:
  15. matchLabels:
  16. {{- include "external-secrets.selectorLabels" . | nindent 6 }}
  17. template:
  18. metadata:
  19. {{- with .Values.podAnnotations }}
  20. annotations:
  21. {{- toYaml . | nindent 8 }}
  22. {{- end }}
  23. labels:
  24. {{- include "external-secrets.selectorLabels" . | nindent 8 }}
  25. {{- with .Values.podLabels }}
  26. {{- toYaml . | nindent 8 }}
  27. {{- end }}
  28. spec:
  29. {{- with .Values.imagePullSecrets }}
  30. imagePullSecrets:
  31. {{- toYaml . | nindent 8 }}
  32. {{- end }}
  33. serviceAccountName: {{ include "external-secrets.serviceAccountName" . }}
  34. {{- with .Values.podSecurityContext }}
  35. securityContext:
  36. {{- toYaml . | nindent 8 }}
  37. {{- end }}
  38. containers:
  39. - name: {{ .Chart.Name }}
  40. {{- with .Values.securityContext }}
  41. securityContext:
  42. {{- toYaml . | nindent 12 }}
  43. {{- end }}
  44. image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  45. imagePullPolicy: {{ .Values.image.pullPolicy }}
  46. {{- if or (.Values.leaderElect) (.Values.scopedNamespace) (.Values.concurrent) (.Values.extraArgs) }}
  47. args:
  48. {{- if .Values.leaderElect }}
  49. - --enable-leader-election=true
  50. {{- end }}
  51. {{- if .Values.scopedNamespace }}
  52. - --namespace={{ .Values.scopedNamespace }}
  53. {{- end }}
  54. {{- if .Values.concurrent }}
  55. - --concurrent={{ .Values.concurrent }}
  56. {{- end }}
  57. {{- range $key, $value := .Values.extraArgs }}
  58. {{- if $value }}
  59. - --{{ $key }}={{ $value }}
  60. {{- else }}
  61. - --{{ $key }}
  62. {{- end }}
  63. {{- end }}
  64. {{- end }}
  65. ports:
  66. - containerPort: {{ .Values.prometheus.service.port }}
  67. protocol: TCP
  68. {{- with .Values.extraEnv }}
  69. env:
  70. {{- toYaml . | nindent 12 }}
  71. {{- end }}
  72. {{- with .Values.resources }}
  73. resources:
  74. {{- toYaml . | nindent 12 }}
  75. {{- end }}
  76. {{- with .Values.nodeSelector }}
  77. nodeSelector:
  78. {{- toYaml . | nindent 8 }}
  79. {{- end }}
  80. {{- with .Values.affinity }}
  81. affinity:
  82. {{- toYaml . | nindent 8 }}
  83. {{- end }}
  84. {{- with .Values.tolerations }}
  85. tolerations:
  86. {{- toYaml . | nindent 8 }}
  87. {{- end }}
  88. {{- if .Values.priorityClassName }}
  89. priorityClassName: {{ .Values.priorityClassName }}
  90. {{- end }}