38 lines
1.1 KiB
Smarty
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 -}}
|