deployment.yaml 2.8 KB

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