|
@@ -1,7 +1,7 @@
|
|
|
{{/*
|
|
|
Expand the name of the chart.
|
|
|
*/}}
|
|
|
-{{- define "hpcc.utils.name" -}}
|
|
|
+{{- define "hpcc.name" -}}
|
|
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
|
|
{{- end -}}
|
|
|
|
|
@@ -10,7 +10,7 @@ Create a default fully qualified app name.
|
|
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
|
If release name contains chart name it will be used as a full name.
|
|
|
*/}}
|
|
|
-{{- define "hpcc.utils.fullname" -}}
|
|
|
+{{- define "hpcc.fullname" -}}
|
|
|
{{- if .Values.fullnameOverride -}}
|
|
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
|
|
{{- else -}}
|
|
@@ -26,12 +26,12 @@ If release name contains chart name it will be used as a full name.
|
|
|
{{/*
|
|
|
Create chart name and version as used by the chart label.
|
|
|
*/}}
|
|
|
-{{- define "hpcc.utils.chart" -}}
|
|
|
+{{- define "hpcc.chart" -}}
|
|
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
|
|
{{- end -}}
|
|
|
|
|
|
{{- /* Translate a port list to a comma-separated list */ -}}
|
|
|
-{{- define "hpcc.utils.portListToCommas" -}}
|
|
|
+{{- define "hpcc.portListToCommas" -}}
|
|
|
{{- if hasPrefix "[]" (typeOf .) -}}
|
|
|
{{- $local := dict "first" true -}}
|
|
|
{{- range $key, $value := . -}}{{- if not $local.first -}},{{- end -}}{{- $value -}}{{- $_ := set $local "first" false -}}{{- end -}}
|
|
@@ -42,7 +42,7 @@ Create chart name and version as used by the chart label.
|
|
|
|
|
|
{{- /* Generate local config info into config section */ -}}
|
|
|
{{- /* Pass in a dictionary with root and me defined */ -}}
|
|
|
-{{- define "hpcc.utils.generateComponentConfigMap" -}}
|
|
|
+{{- define "hpcc.generateComponentConfigMap" -}}
|
|
|
{{- if hasKey .me "configFile" -}}
|
|
|
{{- $filename := (printf "files/%s" .me.configFile) -}}
|
|
|
{{- .me.name -}}.yaml: |
|
|
@@ -55,7 +55,7 @@ Create chart name and version as used by the chart label.
|
|
|
|
|
|
{{- /* Generate a ConfigMap for a component */ -}}
|
|
|
{{- /* Pass in a dictionary with root and me defined */ -}}
|
|
|
-{{- define "hpcc.utils.generateConfigMap" }}
|
|
|
+{{- define "hpcc.generateConfigMap" }}
|
|
|
kind: ConfigMap
|
|
|
apiVersion: v1
|
|
|
metadata:
|
|
@@ -66,61 +66,61 @@ data:
|
|
|
Global:
|
|
|
imageVersion: {{ .root.Values.global.image.version | quote }}
|
|
|
singleNode: {{ .root.Values.global.singleNode }}
|
|
|
-{{ include "hpcc.utils.generateComponentConfigMap" . | indent 2 }}
|
|
|
+{{ include "hpcc.generateComponentConfigMap" . | indent 2 }}
|
|
|
{{ end -}}
|
|
|
|
|
|
{{- /* Add a ConfigMap volume for a component */ -}}
|
|
|
-{{- define "hpcc.utils.addConfigVolume" -}}
|
|
|
+{{- define "hpcc.addConfigVolume" -}}
|
|
|
- name: {{ .name }}-configmap-volume
|
|
|
configMap:
|
|
|
name: {{ .name }}-configmap
|
|
|
{{- end -}}
|
|
|
|
|
|
{{- /* Add a ConfigMap volume mount for a component */ -}}
|
|
|
-{{- define "hpcc.utils.addConfigVolumeMount" -}}
|
|
|
+{{- define "hpcc.addConfigVolumeMount" -}}
|
|
|
- name: {{ .name }}-configmap-volume
|
|
|
mountPath: /etc/config
|
|
|
{{- end -}}
|
|
|
|
|
|
{{- /* Add data volume mount for a component */ -}}
|
|
|
-{{- define "hpcc.utils.addDataVolumeMount" -}}
|
|
|
+{{- define "hpcc.addDataVolumeMount" -}}
|
|
|
- name: datastorage-pv
|
|
|
mountPath: "/var/lib/HPCCSystems/hpcc-data"
|
|
|
{{- end -}}
|
|
|
|
|
|
{{- /* Add standard volumes for a component */ -}}
|
|
|
-{{- define "hpcc.utils.addVolumes" -}}
|
|
|
+{{- define "hpcc.addVolumes" -}}
|
|
|
- name: dllserver-pv-storage
|
|
|
persistentVolumeClaim:
|
|
|
- claimName: {{ .Values.global.dllserver.existingClaim | default (printf "%s-dllserver-pv-claim" (include "hpcc.utils.fullname" .)) }}
|
|
|
+ claimName: {{ .Values.global.dllserver.existingClaim | default (printf "%s-dllserver-pv-claim" (include "hpcc.fullname" .)) }}
|
|
|
- name: datastorage-pv
|
|
|
persistentVolumeClaim:
|
|
|
- claimName: {{ .Values.global.dataStorage.existingClaim | default (printf "%s-datastorage-pv-claim" (include "hpcc.utils.fullname" .)) }}
|
|
|
+ claimName: {{ .Values.global.dataStorage.existingClaim | default (printf "%s-datastorage-pv-claim" (include "hpcc.fullname" .)) }}
|
|
|
{{- end -}}
|
|
|
|
|
|
{{- /* Add standard volume mounts for a component */ -}}
|
|
|
-{{- define "hpcc.utils.addVolumeMounts" -}}
|
|
|
+{{- define "hpcc.addVolumeMounts" -}}
|
|
|
volumeMounts:
|
|
|
-{{ include "hpcc.utils.addConfigVolumeMount" . }}
|
|
|
-{{ include "hpcc.utils.addDataVolumeMount" . }}
|
|
|
+{{ include "hpcc.addConfigVolumeMount" . }}
|
|
|
+{{ include "hpcc.addDataVolumeMount" . }}
|
|
|
- name: dllserver-pv-storage
|
|
|
mountPath: "/var/lib/HPCCSystems/queries"
|
|
|
{{- end -}}
|
|
|
|
|
|
{{- /* Add config arg for a component */ -}}
|
|
|
-{{- define "hpcc.utils.configArg" -}}
|
|
|
+{{- define "hpcc.configArg" -}}
|
|
|
{{- if or (hasKey . "configFile") (hasKey . "config") -}}
|
|
|
"--config=/etc/config/{{ .name }}.yaml", {{ end -}}
|
|
|
"--global=/etc/config/global.yaml"
|
|
|
{{- end -}}
|
|
|
|
|
|
{{- /* Add dali arg for a component */ -}}
|
|
|
-{{- define "hpcc.utils.daliArg" -}}
|
|
|
+{{- define "hpcc.daliArg" -}}
|
|
|
"--daliServers={{ (index .Values.dali 0).name }}"
|
|
|
{{- end -}}
|
|
|
|
|
|
{{- /* Get image name */ -}}
|
|
|
-{{- define "hpcc.utils.imageName" -}}
|
|
|
+{{- define "hpcc.imageName" -}}
|
|
|
{{- /* Pass in a dictionary with root, me and imagename defined */ -}}
|
|
|
{{- if .me.image -}}
|
|
|
{{ .me.image.root | default .root.Values.global.image.root | default "hpccsystems" }}/{{ .imagename }}:{{ .me.image.version | default .root.Values.global.image.version }}
|
|
@@ -131,8 +131,8 @@ volumeMounts:
|
|
|
|
|
|
{{- /* Add image attributes for a component */ -}}
|
|
|
{{- /* Pass in a dictionary with root, me and imagename defined */ -}}
|
|
|
-{{- define "hpcc.utils.addImageAttrs" -}}
|
|
|
-image: {{ include "hpcc.utils.imageName" . | quote }}
|
|
|
+{{- define "hpcc.addImageAttrs" -}}
|
|
|
+image: {{ include "hpcc.imageName" . | quote }}
|
|
|
{{ if .me.image -}}
|
|
|
imagePullPolicy: {{ .me.image.pullPolicy | default .root.Values.global.image.pullPolicy | default "IfNotPresent" }}
|
|
|
{{- else -}}
|