{{- $templates := dict "regional-server-root-config" "root-config.yaml" "regional-server-addon-template-config" "k8s-addon-templates.yaml" "regional-server-infra-template-config" "k8s-infra-templates.yaml" "regional-server-dedicated-template-config" "k8s-dedicated-templates.yaml" "regional-server-dp-template-config" "k8s-dp-templates.yaml" }}
{{- range $name,$file := $templates }}
---
{{- $filepath := printf "configmap/config/%s_%s_%s/%s" $.Values.cloudProvider $.Values.env $.Values.region $file }}
# configmap file: {{ $filepath }}
{{- $content := $.Files.Get $filepath }}
{{- if eq $content "" }}
{{- fail (printf "config file %s not found" $filepath) }}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ $name }}
data:
  {{ $file }}: |
    {{- $content | nindent 4 }}
{{- end }}