89 lines
3.4 KiB
YAML
89 lines
3.4 KiB
YAML
apiVersion: {{ template "apiVersion" . }}
|
|
kind: {{ .Values.workloadType }}
|
|
metadata:
|
|
name: {{ include "ix-chart.fullname" . }}
|
|
labels:
|
|
{{- include "ix-chart.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if eq (include "workloadIsDeployment" .) "true" }}
|
|
strategy:
|
|
type: {{ .Values.updateStrategy }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "ix-chart.selectorLabels" . | nindent 6 }}
|
|
{{- end }}
|
|
{{- if ne (include "workloadIsCronJob" .) "true" }}
|
|
template:
|
|
{{- else }}
|
|
schedule: {{ .Values.cronSchedule | quote }}
|
|
jobTemplate:
|
|
{{- end }}
|
|
metadata:
|
|
labels:
|
|
{{- include "ix-chart.selectorLabels" . | nindent 8 }}
|
|
annotations:
|
|
rollme: {{ randAlphaNum 5 | quote }}
|
|
{{- if .Values.ixExternalInterfacesConfigurationNames }}
|
|
k8s.v1.cni.cncf.io/networks: {{ join ", " .Values.ixExternalInterfacesConfigurationNames }}
|
|
{{- end }}
|
|
spec:
|
|
restartPolicy: {{ template "restartPolicy" . }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
{{- if or .Values.hostPathVolumes .Values.persistentVolumeClaims }}
|
|
volumeMounts:
|
|
{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
|
|
- mountPath: {{ $hostPathConfiguration.mountPath }}
|
|
name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
|
|
readOnly: {{ $hostPathConfiguration.readOnly }}
|
|
{{- end }}
|
|
{{- range $index, $claim := .Values.persistentVolumeClaims }}
|
|
- mountPath: {{ $claim.mountPath }}
|
|
name: ix-pv-{{ $.Release.Name }}-{{ $index }}
|
|
{{- end }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
{{- if .Values.containerCommand }}
|
|
command:
|
|
{{- range .Values.containerCommand }}
|
|
- {{ . | quote}}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.containerArgs }}
|
|
args:
|
|
{{- range .Values.containerArgs }}
|
|
- {{ . | quote}}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.containerEnvironmentVariables }}
|
|
env:
|
|
{{- range .Values.containerEnvironmentVariables }}
|
|
- name: {{ .name | quote }}
|
|
value: {{ .value | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.livenessProbe }}
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
{{ toYaml .Values.livenessProbe.command | indent 16 }}
|
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.periodSeconds }}
|
|
{{- end }}
|
|
{{- if or .Values.persistentVolumeClaims .Values.hostPathVolumes }}
|
|
volumes:
|
|
{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
|
|
- name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
|
|
hostPath:
|
|
path: {{ $hostPathConfiguration.hostPath }}
|
|
{{- end }}
|
|
{{- range $index, $claim := .Values.persistentVolumeClaims }}
|
|
- name: ix-pv-{{ $.Release.Name }}-{{ $index }}
|
|
persistentVolumeClaim:
|
|
claimName: ix-pv-claim-{{ $.Release.Name }}-{{ $index }}
|
|
{{- end }}
|
|
{{- end }}
|