deployment.yaml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.extraArgs) }}
  43. args:
  44. {{- if .Values.leaderElect }}
  45. - --enable-leader-election=true
  46. {{- end }}
  47. {{- range $key, $value := .Values.extraArgs }}
  48. {{- if $value }}
  49. - --{{ $key }}={{ $value }}
  50. {{- else }}
  51. - --{{ $key }}
  52. {{- end }}
  53. {{- end }}
  54. {{- end }}
  55. ports:
  56. - containerPort: {{ .Values.prometheus.service.port }}
  57. protocol: TCP
  58. {{- with .Values.extraEnv }}
  59. env:
  60. {{- toYaml . | nindent 12 }}
  61. {{- end }}
  62. {{- with .Values.resources }}
  63. resources:
  64. {{- toYaml . | nindent 12 }}
  65. {{- end }}
  66. {{- with .Values.nodeSelector }}
  67. nodeSelector:
  68. {{- toYaml . | nindent 8 }}
  69. {{- end }}
  70. {{- with .Values.affinity }}
  71. affinity:
  72. {{- toYaml . | nindent 8 }}
  73. {{- end }}
  74. {{- with .Values.tolerations }}
  75. tolerations:
  76. {{- toYaml . | nindent 8 }}
  77. {{- end }}
  78. {{- if .Values.priorityClassName }}
  79. priorityClassName: {{ .Values.priorityClassName }}
  80. {{- end }}