Files
devops-infra-helm-charts-gcp/helm-templates/node-thp-config/templates/_helpers.tpl
T
2026-08-26 03:39:42 +05:30

47 lines
1.2 KiB
Smarty

{{/*
Generate the complete node affinity configuration
*/}}
{{- define "node-thp-config.nodeAffinity" -}}
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
{{- if .Values.baseMatchExpressions }}
- matchExpressions:
{{- include "node-thp-config.baseMatchExpressions" . | nindent 6 }}
{{- end }}
{{- if and .Values.addExtraMatchExpressions .Values.additionalMatchExpressions }}
- matchExpressions:
{{- include "node-thp-config.additionalMatchExpressions" . | nindent 6 }}
{{- end }}
{{- end }}
{{/*
Generate the base matchExpressions (always included)
*/}}
{{- define "node-thp-config.baseMatchExpressions" -}}
{{- range .Values.baseMatchExpressions }}
- key: {{ .key }}
operator: {{ .operator }}
values:
{{- range .values }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Generate additional matchExpressions if enabled
*/}}
{{- define "node-thp-config.additionalMatchExpressions" -}}
{{- if and .Values.addExtraMatchExpressions .Values.additionalMatchExpressions }}
{{- range .Values.additionalMatchExpressions }}
- key: {{ .key }}
operator: {{ .operator }}
values:
{{- range .values }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}