Files
mixingx.hub.chart/release-charts/mixingx-platform/templates/_helpers.tpl
T

38 lines
1.1 KiB
Smarty

{{- define "mixingx-platform.storageClassName" -}}
{{- .Values.storage.className | default "local-path" -}}
{{- end -}}
{{- define "mixingx-platform.tierAffinity" -}}
{{- $root := .root -}}
{{- $role := .role -}}
{{- if and $root.Values.tier $root.Values.tier.enabled -}}
{{- $service := index $root.Values.tier.services $role -}}
{{- if $service }}
affinity:
nodeAffinity:
{{- if eq ($service.mode | default "preferred") "required" }}
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: {{ $root.Values.tier.nodeLabel }}
operator: In
values:
{{- range $service.tiers }}
- {{ . }}
{{- end }}
{{- else }}
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: {{ $root.Values.tier.nodeLabel }}
operator: In
values:
{{- range $service.tiers }}
- {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}