Bläddra i källkod

Merge pull request #13373 from richardkchapman/localimage

HPCC-23530 Helm chart support for mixed versions

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 5 år sedan
förälder
incheckning
2be94aaaef

+ 13 - 4
dockerfiles/hpcc/templates/_util.tpl

@@ -33,6 +33,7 @@ data:
     version: "1.0"
     Global:
       imageVersion: {{ .root.Values.global.image.version | quote }}
+      singleNode: {{ .root.Values.global.singleNode }}
 {{ include "hpcc.utils.generateComponentConfigMap" . | indent 2 }}
 {{ end -}}
 
@@ -80,15 +81,23 @@ volumeMounts:
 
 {{- /* Get image name */ -}}
 {{- define "hpcc.utils.imageName" -}}
-{{- /* Pass in a dictionary with root and imagename defined */ -}}
+{{- /* 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 }}
+{{- else -}}
 {{ .root.Values.global.image.root | default "hpccsystems" }}/{{ .imagename }}:{{ .root.Values.global.image.version }}
 {{- end -}}
+{{- end -}}
 
 {{- /* Add image attributes for a component */ -}}
-{{- /* Pass in a dictionary with root and imagename defined */ -}}
+{{- /* Pass in a dictionary with root, me and imagename defined */ -}}
 {{- define "hpcc.utils.addImageAttrs" -}}
-image: "{{ include "hpcc.utils.imageName" . }}"
-imagePullPolicy: {{ .root.Values.global.image.pullPolicy }}
+image: {{ include "hpcc.utils.imageName" . | quote }}
+{{ if .me.image -}}
+imagePullPolicy: {{ .me.image.pullPolicy | default .root.Values.global.image.pullPolicy | default "IfNotPresent" }}
+{{- else -}}
+imagePullPolicy: {{ .root.Values.global.image.pullPolicy | default "IfNotPresent" }}
+{{- end -}}
 {{- end -}}
 
 {{- /* A kludge to ensure host mounted storage (e.g. for minikube or docker for desktop) has correct permissions for PV */ -}}

+ 1 - 1
dockerfiles/hpcc/templates/dali.yaml

@@ -18,7 +18,7 @@ spec:
         args: [
                 # {{ include "hpcc.utils.configArg" . }} - dali does not support this yet
               ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "dali") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" . "imagename" "dali") | indent 8 }}
         volumeMounts:
 {{ include "hpcc.utils.addConfigVolumeMount" . | indent 8 }}
       volumes:

+ 2 - 2
dockerfiles/hpcc/templates/eclagent.yaml

@@ -20,7 +20,7 @@ spec:
                 {{ include "hpcc.utils.configArg" . }},
                 {{ include "hpcc.utils.daliArg" $ }}
               ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "eclagent") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" . "imagename" "eclagent") | indent 8 }}
 {{ include "hpcc.utils.addVolumeMounts" . | indent 8 }}
 {{ include "hpcc.utils.addVolumes" . | indent 6 }}
 ---
@@ -36,7 +36,7 @@ spec:
         spec:
           containers:
           - name: %jobname
-            image: {{ include "hpcc.utils.imageName" (dict "root" $ "imagename" "eclagent") }}
+            image: {{ include "hpcc.utils.imageName" (dict "root" $ "me" . "imagename" "eclagent") }}
             resources:
               requests:
                 #request-memory

+ 2 - 2
dockerfiles/hpcc/templates/eclccserver.yaml

@@ -25,7 +25,7 @@ spec:
                 {{ include "hpcc.utils.configArg" . }},
                 {{ include "hpcc.utils.daliArg" $ }}
               ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "eclccserver") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" . "imagename" "eclccserver") | indent 8 }}
 {{ include "hpcc.utils.addVolumeMounts" . | indent 8 }}
 {{ include "hpcc.utils.addVolumes" . | indent 6 }}
 ---
@@ -41,7 +41,7 @@ spec:
         spec:
           containers:
           - name: %jobname
-            image: {{ include "hpcc.utils.imageName" (dict "root" $ "imagename" "eclccserver") }}
+            image: {{ include "hpcc.utils.imageName" (dict "root" $ "me" . "imagename" "eclccserver") }}
             resources:
               requests:
                 #request-memory

+ 1 - 1
dockerfiles/hpcc/templates/esp.yaml

@@ -19,7 +19,7 @@ spec:
                 # {{ include "hpcc.utils.configArg" . }},
                 # {{ include "hpcc.utils.daliArg" $ }}
               ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "esp") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" . "imagename" "esp") | indent 8 }}
 {{ include "hpcc.utils.addVolumeMounts" . | indent 8 }}
 {{ include "hpcc.utils.addVolumes" . | indent 6 }}
 ---

+ 1 - 1
dockerfiles/hpcc/templates/localroxie.yaml

@@ -24,7 +24,7 @@ spec:
                 "--serverPorts={{ template "hpcc.utils.portListToCommas" $roxie.ports }}", 
                 "--localSlave=true"
               ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "roxie") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" . "imagename" "roxie") | indent 8 }}
 {{ include "hpcc.utils.addVolumeMounts" . | indent 8 }}
 {{ include "hpcc.utils.addVolumes" . | indent 6 }}
 ---

+ 3 - 3
dockerfiles/hpcc/templates/roxie.yaml

@@ -21,7 +21,7 @@ spec:
       containers:
       - name: {{ $toponame | quote }}
         args: [ "--port={{ $topoport }}" ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "toposerver") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" $roxie "imagename" "toposerver") | indent 8 }}
         volumeMounts:
 {{ include "hpcc.utils.addConfigVolumeMount" . | indent 8 }}
       volumes:
@@ -74,7 +74,7 @@ spec:
                 "--topologyServers={{ $toponame }}:{{ $roxie.topoport }}",
                 "--localSlave=false"
               ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "roxie") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" $roxie "imagename" "roxie") | indent 8 }}
 {{ include "hpcc.utils.addVolumeMounts" . | indent 8 }}
 {{ include "hpcc.utils.addVolumes" . | indent 6 }}
 ---
@@ -109,7 +109,7 @@ spec:
                 "--localSlave=false", 
                 "--topologyServers={{ $toponame }}:{{ $roxie.topoport }}",
               ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "roxie") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" $roxie "imagename" "roxie") | indent 8 }}
 {{ include "hpcc.utils.addVolumeMounts" $roxie | indent 8 }}
 {{ include "hpcc.utils.addVolumes" $roxie | indent 6 }}
 

+ 3 - 3
dockerfiles/hpcc/templates/thor.yaml

@@ -30,7 +30,7 @@ spec:
                 --masterport={{ $masterPort }},
                 --numSlaves={{ $thor.numSlaves }}
               ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "thormaster") | indent 8 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" . "imagename" "thormaster") | indent 8 }}
 {{ include "hpcc.utils.addVolumeMounts" . | indent 8 }}
 {{ include "hpcc.utils.addVolumes" . | indent 6 }}
 ---
@@ -59,7 +59,7 @@ spec:
                   --slaveport={{ $slavePort }},
                   --master={{ printf "%s:%v" $serviceName $masterPort }}
                 ]
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "thorslave") | indent 10 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" . "imagename" "thorslave") | indent 10 }}
           ports:
             - containerPort: {{ $slavePort }}
 {{ include "hpcc.utils.addVolumeMounts" . | indent 10 }}
@@ -67,7 +67,7 @@ spec:
             mountPath: "/var/lib/HPCCSystems/hpcc-data"
         {{- if $thor.startDafilesrv | default false }}
         - name: {{ printf "%s-dafilesrv" $slaveName | quote }}
-{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "imagename" "thorslave") | indent 10 }}
+{{ include "hpcc.utils.addImageAttrs" (dict "root" $ "me" . "imagename" "thorslave") | indent 10 }}
           command: ["dafilesrv"]
           ports:
             - containerPort: 7100