refactor: $values => $pod

This commit is contained in:
Chi-En Wu
2020-04-22 17:19:41 +08:00
parent 9a5a128c6e
commit 5e84d4fb5f

View File

@ -2,29 +2,29 @@
{{- define "common.pod.template.tpl" -}} {{- define "common.pod.template.tpl" -}}
{{- $top := first . -}} {{- $top := first . -}}
{{- $values := index . 1 -}} {{- $pod := index . 1 -}}
metadata: metadata:
labels: labels:
{{- include "common.selectorLabels" $top | nindent 4 }} {{- include "common.selectorLabels" $top | nindent 4 }}
spec: spec:
{{- with $values.imagePullSecrets }} {{- with $pod.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "common.serviceAccountName" $top }} serviceAccountName: {{ include "common.serviceAccountName" $top }}
securityContext: securityContext:
{{- toYaml $values.podSecurityContext | nindent 4 }} {{- toYaml $pod.podSecurityContext | nindent 4 }}
containers: containers:
- {{- include "common.container" . | nindent 6 }} - {{- include "common.container" . | nindent 6 }}
{{- with $values.nodeSelector }} {{- with $pod.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with $values.affinity }} {{- with $pod.affinity }}
affinity: affinity:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with $values.tolerations }} {{- with $pod.tolerations }}
tolerations: tolerations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}