deployment.yaml 2.5 KB

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