forked from evry-ace/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_pod.tpl
77 lines (70 loc) · 2.03 KB
/
_pod.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{{- define "libchart.pod" -}}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{ range $s := .Values.image.pullSecrets }}
- name: {{ $s }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "libchart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 2 }}
{{- if .Values.initContainers }}
initContainers:
{{ toYaml .Values.initContainers | nindent 2 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- include "libchart.container" .Values | indent 2 -}}
{{- range $sc := .Values.sidecars -}}
{{ "- name: " | nindent 2 }}{{ $sc.name }}
{{- include "libchart.container" $sc | indent 2 }}
{{- end }}
{{- if .Values.initContainers }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 4 }}
{{- end }}
{{- if or .Values.affinity .Values.podAntiAffinity }}
affinity:
{{- with .Values.affinity }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if eq .Values.podAntiAffinity "hard" }}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: "{{ .Values.podAntiAffinityTopologyKey }}"
labelSelector:
matchLabels:
{{- include "libchart.selectorLabels" . | nindent 12 }}
{{- else if eq .Values.podAntiAffinity "soft" }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
topologyKey: "{{ .Values.podAntiAffinityTopologyKey }}"
labelSelector:
matchLabels:
{{- include "libchart.selectorLabels" . | nindent 14 }}
{{- end }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{ toYaml . | nindent 2 }}
{{- end -}}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | nindent 2 }}
{{- end }}
{{- if or (.Values.volumes) (.Values.csi) }}
volumes:
{{- if .Values.volumes }}
{{ toYaml .Values.volumes | nindent 2 }}
{{- end }}
{{- if .Values.csi }}
- name: {{ .Values.csi.name }}
persistentVolumeClaim:
claimName: {{ .Values.csi.name }}
{{- end }}
{{- end }}
{{- end }}