deployment.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.controllerClass }}
  55. - --controller-class={{ .Values.controllerClass }}
  56. {{- end }}
  57. {{- if .Values.concurrent }}
  58. - --concurrent={{ .Values.concurrent }}
  59. {{- end }}
  60. {{- range $key, $value := .Values.extraArgs }}
  61. {{- if $value }}
  62. - --{{ $key }}={{ $value }}
  63. {{- else }}
  64. - --{{ $key }}
  65. {{- end }}
  66. {{- end }}
  67. {{- end }}
  68. {{- if .Values.webhook.enabled }}
  69. volumeMounts:
  70. - name: certs
  71. mountPath: {{ .Values.webhook.certDir }}
  72. {{- end }}
  73. ports:
  74. - containerPort: {{ .Values.prometheus.service.port }}
  75. protocol: TCP
  76. name: metrics
  77. - containerPort: 9443
  78. protocol: TCP
  79. name: webhook
  80. {{- with .Values.extraEnv }}
  81. env:
  82. {{- toYaml . | nindent 12 }}
  83. {{- end }}
  84. {{- with .Values.resources }}
  85. resources:
  86. {{- toYaml . | nindent 12 }}
  87. {{- end }}
  88. {{- if .Values.webhook.enabled }}
  89. volumes:
  90. - name: certs
  91. secret:
  92. secretName: {{ include "external-secrets.fullname" . }}-webhook
  93. {{- end }}
  94. {{- with .Values.nodeSelector }}
  95. nodeSelector:
  96. {{- toYaml . | nindent 8 }}
  97. {{- end }}
  98. {{- with .Values.affinity }}
  99. affinity:
  100. {{- toYaml . | nindent 8 }}
  101. {{- end }}
  102. {{- with .Values.tolerations }}
  103. tolerations:
  104. {{- toYaml . | nindent 8 }}
  105. {{- end }}
  106. {{- if .Values.priorityClassName }}
  107. priorityClassName: {{ .Values.priorityClassName }}
  108. {{- end }}