deployment.yaml 2.7 KB

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