deployment.yaml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. ports:
  69. - containerPort: {{ .Values.prometheus.service.port }}
  70. protocol: TCP
  71. name: metrics
  72. {{- with .Values.extraEnv }}
  73. env:
  74. {{- toYaml . | nindent 12 }}
  75. {{- end }}
  76. {{- with .Values.resources }}
  77. resources:
  78. {{- toYaml . | nindent 12 }}
  79. {{- end }}
  80. {{- with .Values.nodeSelector }}
  81. nodeSelector:
  82. {{- toYaml . | nindent 8 }}
  83. {{- end }}
  84. {{- with .Values.affinity }}
  85. affinity:
  86. {{- toYaml . | nindent 8 }}
  87. {{- end }}
  88. {{- with .Values.tolerations }}
  89. tolerations:
  90. {{- toYaml . | nindent 8 }}
  91. {{- end }}
  92. {{- if .Values.priorityClassName }}
  93. priorityClassName: {{ .Values.priorityClassName }}
  94. {{- end }}