diff --git a/helm/hpcc/templates/localroxie.yaml b/helm/hpcc/templates/localroxie.yaml index e1aa64321dd..2ddd3868e6a 100644 --- a/helm/hpcc/templates/localroxie.yaml +++ b/helm/hpcc/templates/localroxie.yaml @@ -33,27 +33,27 @@ data: {{ .me.name }}.yaml: version: 1.0 roxie: -{{ toYaml (omit .me "logging" "env") | indent 6 }} -{{- include "hpcc.generateLoggingConfig" . | indent 6 }} -{{ include "hpcc.generateVaultConfig" . | indent 6 }} +{{ toYaml (omit .me "logging" "env") | indent 6 }} +{{- include "hpcc.generateLoggingConfig" . | indent 6 }} +{{ include "hpcc.generateVaultConfig" . | indent 6 }} global: -{{ include "hpcc.generateGlobalConfigMap" .root | indent 6 }} -{{- end -}} +{{ include "hpcc.generateGlobalConfigMap" .root | indent 6 }} +{{- end -}}{{/* define "hpcc.localroxieConfigMap */}} -{{ range $roxie := $.Values.roxie -}} -{{- if not $roxie.disabled -}} -{{- $env := concat ($.Values.global.env | default list) (.env | default list) -}} -{{- $secretsCategories := list "system" "eclUser" "ecl" "storage" }} -{{- $enginePlaneDetails := dict -}} -{{- $_ := include "hpcc.getEnginePlanes" (dict "root" $ "me" . "result" $enginePlaneDetails) -}} -{{- $commonCtx := dict "root" $ "me" $roxie "includeCategories" $enginePlaneDetails.planeCategories "includeNames" $enginePlaneDetails.namedPlanes "secretsCategories" $secretsCategories "env" $env }} -{{- $configSHA := include "hpcc.getConfigSHA" ($commonCtx | merge (dict "configMapHelper" "hpcc.localroxieConfigMap" "component" "roxie" "excludeKeys" "global")) }} -{{- include "hpcc.checkDefaultStoragePlane" $commonCtx }} -{{- $singleNode := (hasKey $roxie "singleNode") | ternary $roxie.singleNode ((hasKey $roxie "localAgent") | ternary $roxie.localAgent false) }} -{{- if $singleNode -}} -{{- $localAgent := ((hasKey $roxie "localAgent") | ternary $roxie.localAgent true) -}} -{{- $name := $roxie.name -}} -{{- $servername := printf "%s-server" $roxie.name -}} +{{ range $roxie := $.Values.roxie -}} +{{- if not $roxie.disabled -}} +{{- $env := concat ($.Values.global.env | default list) (.env | default list) -}} +{{- $secretsCategories := list "system" "eclUser" "ecl" "storage" }} +{{- $enginePlaneDetails := dict -}} +{{- $_ := include "hpcc.getEnginePlanes" (dict "root" $ "me" . "result" $enginePlaneDetails) -}} +{{- $commonCtx := dict "root" $ "me" $roxie "includeCategories" $enginePlaneDetails.planeCategories "includeNames" $enginePlaneDetails.namedPlanes "secretsCategories" $secretsCategories "env" $env }} +{{- $configSHA := include "hpcc.getConfigSHA" ($commonCtx | merge (dict "configMapHelper" "hpcc.localroxieConfigMap" "component" "roxie" "excludeKeys" "global")) }} +{{- include "hpcc.checkDefaultStoragePlane" $commonCtx }} +{{- $singleNode := (hasKey $roxie "singleNode") | ternary $roxie.singleNode ((hasKey $roxie "localAgent") | ternary $roxie.localAgent false) }} +{{- if $singleNode -}} +{{- $localAgent := ((hasKey $roxie "localAgent") | ternary $roxie.localAgent true) -}} +{{- $name := $roxie.name -}} +{{- $servername := printf "%s-server" $roxie.name -}} apiVersion: apps/v1 kind: Deployment @@ -73,21 +73,21 @@ spec: accessDali: "yes" accessEsp: "yes" helmVersion: 9.5.0-trunk0 - {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "roxie-server" "name" "roxie" "instance" $roxie.name) | indent 8 }} -{{- if hasKey . "labels" }} -{{ toYaml .labels | indent 8 }} -{{- end }} +{{- include "hpcc.addStandardLabels" (dict "root" $ "component" "roxie-server" "name" "roxie" "instance" $roxie.name) | indent 8 }} +{{- if hasKey . "labels" }} +{{ toYaml .labels | indent 8 }} +{{- end }} annotations: checksum/config: {{ $configSHA }} -{{- if hasKey . "annotations" }} -{{ toYaml .annotations | indent 8 }} -{{- end }} +{{- if hasKey . "annotations" }} +{{ toYaml .annotations | indent 8 }} +{{- end }} spec: - {{- include "hpcc.placementsByPodTargetType" (dict "root" $ "pod" $roxie.name "target" $roxie.name "type" "roxie") | indent 6 }} +{{- include "hpcc.placementsByPodTargetType" (dict "root" $ "pod" $roxie.name "target" $roxie.name "type" "roxie") | indent 6 }} serviceAccountName: "hpcc-default" initContainers: - {{- include "hpcc.createConfigInitContainers" $commonCtx | indent 6 }} - {{- include "hpcc.addImagePullSecrets" $commonCtx | nindent 6 -}} +{{- include "hpcc.createConfigInitContainers" $commonCtx | indent 6 }} +{{- include "hpcc.addImagePullSecrets" $commonCtx | nindent 6 -}} containers: - name: {{ $roxie.name | quote }} workingDir: /var/lib/HPCCSystems @@ -100,55 +100,55 @@ spec: "--resolveLocally=false" ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ $roxie.name }}.sentinel" -{{- $local := dict "first" true }} -{{- range $service := $roxie.services }} -{{- if ne (int $service.servicePort) 0 }} -{{- if $local.first }} -{{- $_ := set $local "first" false }} +{{- $local := dict "first" true }} +{{- range $service := $roxie.services }} +{{- if ne (int $service.servicePort) 0 }} +{{- if $local.first }} +{{- $_ := set $local "first" false }} ports: -{{- end }} +{{- end }} - name: {{ $service.name }} containerPort: {{ $service.servicePort }} -{{- end }} -{{- end }} -{{- include "hpcc.addSecurityContext" $commonCtx | indent 8 }} -{{- include "hpcc.addResources" (dict "me" $roxie.resources) | indent 8 }} -{{ include "hpcc.addImageAttrs" $commonCtx | indent 8 }} +{{- end }} +{{- end }} +{{- include "hpcc.addSecurityContext" $commonCtx | indent 8 }} +{{- include "hpcc.addResources" (dict "me" $roxie.resources) | indent 8 }} +{{ include "hpcc.addImageAttrs" $commonCtx | indent 8 }} volumeMounts: -{{ include "hpcc.addConfigMapVolumeMount" . | indent 8 }} -{{ include "hpcc.addVolumeMounts" $commonCtx | indent 8 }} -{{- include "hpcc.addSecretVolumeMounts" $commonCtx | indent 8 }} -{{ include "hpcc.addVaultClientCertificateVolumeMounts" $commonCtx | indent 8 }} -{{ include "hpcc.addCertificateVolumeMount" (dict "root" $ "name" $roxie.name "component" "localroxie" "external" false) | indent 8 }} -{{ include "hpcc.addCertificateVolumeMount" (dict "root" $ "name" $roxie.name "component" "localroxie" "external" true "includeRemote" true) | indent 8 }} -{{ include "hpcc.addUDPCertificateVolumeMount" (dict "root" $ "name" $roxie.name "component" "localudpkey" ) | indent 8 }} +{{ include "hpcc.addConfigMapVolumeMount" . | indent 8 }} +{{ include "hpcc.addVolumeMounts" $commonCtx | indent 8 }} +{{- include "hpcc.addSecretVolumeMounts" $commonCtx | indent 8 }} +{{ include "hpcc.addVaultClientCertificateVolumeMounts" $commonCtx | indent 8 }} +{{ include "hpcc.addCertificateVolumeMount" (dict "root" $ "name" $roxie.name "component" "localroxie" "external" false) | indent 8 }} +{{ include "hpcc.addCertificateVolumeMount" (dict "root" $ "name" $roxie.name "component" "localroxie" "external" true "includeRemote" true) | indent 8 }} +{{ include "hpcc.addUDPCertificateVolumeMount" (dict "root" $ "name" $roxie.name "component" "localudpkey" ) | indent 8 }} volumes: -{{ include "hpcc.addConfigMapVolume" . | indent 6 }} -{{ include "hpcc.addVolumes" $commonCtx | indent 6 }} -{{ include "hpcc.addSecretVolumes" $commonCtx | indent 6 }} -{{ include "hpcc.addVaultClientCertificateVolumes" $commonCtx | indent 6 }} -{{ include "hpcc.addCertificateVolume" (dict "root" $ "name" $roxie.name "component" "localroxie" "external" false) | indent 6 }} -{{ include "hpcc.addCertificateVolume" (dict "root" $ "name" $roxie.name "component" "localroxie" "external" true "includeRemote" true) | indent 6 }} -{{ include "hpcc.addUDPCertificateVolume" (dict "root" $ "name" $roxie.name "component" "localudpkey" ) | indent 6 }} +{{ include "hpcc.addConfigMapVolume" . | indent 6 }} +{{ include "hpcc.addVolumes" $commonCtx | indent 6 }} +{{ include "hpcc.addSecretVolumes" $commonCtx | indent 6 }} +{{ include "hpcc.addVaultClientCertificateVolumes" $commonCtx | indent 6 }} +{{ include "hpcc.addCertificateVolume" (dict "root" $ "name" $roxie.name "component" "localroxie" "external" false) | indent 6 }} +{{ include "hpcc.addCertificateVolume" (dict "root" $ "name" $roxie.name "component" "localroxie" "external" true "includeRemote" true) | indent 6 }} +{{ include "hpcc.addUDPCertificateVolume" (dict "root" $ "name" $roxie.name "component" "localudpkey" ) | indent 6 }} --- -{{- range $service := $roxie.services }} -{{- if ne (int $service.servicePort) 0 }} -{{ include "hpcc.addService" ( dict "root" $ "name" $service.name "service" $service "selector" $servername "defaultPort" $service.servicePort ) }} +{{- range $service := $roxie.services }} +{{- if ne (int $service.servicePort) 0 }} +{{ include "hpcc.addService" ( dict "root" $ "name" $service.name "service" $service "selector" $servername "defaultPort" $service.servicePort ) }} --- -{{- end }} -{{- end }} +{{- end }} +{{- end }} kind: ConfigMap -{{ include "hpcc.generateConfig" ($commonCtx | merge (dict "configMapHelper" "hpcc.localroxieConfigMap")) }} +{{ include "hpcc.generateConfig" ($commonCtx | merge (dict "configMapHelper" "hpcc.localroxieConfigMap")) }} --- -{{ include "hpcc.addCertificate" (dict "root" $ "name" $roxie.name "services" $roxie.services "component" "localroxie" "external" false) }} -{{ include "hpcc.addCertificate" (dict "root" $ "name" $roxie.name "services" $roxie.services "component" "localroxie" "external" true "includeRemote" true) }} -{{ include "hpcc.addUDPCertificate" (dict "root" $ "name" $roxie.name "component" "localudpkey") }} +{{ include "hpcc.addCertificate" (dict "root" $ "name" $roxie.name "services" $roxie.services "component" "localroxie" "external" false) }} +{{ include "hpcc.addCertificate" (dict "root" $ "name" $roxie.name "services" $roxie.services "component" "localroxie" "external" true "includeRemote" true) }} +{{ include "hpcc.addUDPCertificate" (dict "root" $ "name" $roxie.name "component" "localudpkey") }} --- -{{ include "hpcc.addEgress" $commonCtx }} +{{ include "hpcc.addEgress" $commonCtx }} -{{- end }} -{{- end }} -{{- end }} +{{- end }}{{/* if singleNode */}} +{{- end }}{{/* if not disabled */}} +{{- end }}{{/* range */}}