Skip to content

Commit f70d6b0

Browse files
Mike LudwigMike Ludwig
authored andcommitted
docker login on invoker pods when using private registry
1 parent 3899c47 commit f70d6b0

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker login $RUNTIMES_REGISTRY -u $RUNTIMES_REGISTRY_USERNAME -p $RUNTIMES_REGISTRY_PASSWORD

helm/openwhisk/templates/_helpers.tpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ imagePullSecrets:
310310
mountPath: "/invoker-scripts/configureDNS.sh"
311311
subPath: "configureDNS.sh"
312312
{{- end }}
313+
{{- if ne .Values.docker.registry.name "" }}
314+
- name: scripts-dir
315+
mountPath: "/invoker-scripts/dockerLogin.sh"
316+
subPath: "dockerLogin.sh"
317+
{{- end }}
313318
{{- end }}
314319
{{- end }}
315320

helm/openwhisk/templates/invoker-cm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ metadata:
2424
data:
2525
{{ (.Files.Glob "configMapFiles/dockerPullRuntimes/playbook.yml").AsConfig | indent 2 }}
2626
{{ (.Files.Glob "configMapFiles/configureDNS/configureDNS.sh").AsConfig | indent 2 }}
27+
{{ (.Files.Glob "configMapFiles/dockerLogin/dockerLogin.sh").AsConfig | indent 2 }}

helm/openwhisk/templates/invoker-pod.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,17 @@ spec:
8383
- name: invoker
8484
image: "{{- .Values.docker.registry.name -}}{{- .Values.invoker.imageName -}}:{{- .Values.invoker.imageTag -}}"
8585
imagePullPolicy: {{ .Values.invoker.imagePullPolicy | quote }}
86+
command:
87+
- /bin/bash
88+
- -c
89+
-
90+
{{- if ne .Values.docker.registry.name "" }}
91+
. /invoker-scripts/dockerLogin.sh &&
92+
{{- end }}
8693
{{- if and (eq .Values.invoker.containerFactory.impl "docker") .Values.invoker.containerFactory.networkConfig.dns.inheritInvokerConfig }}
87-
command: [ "/bin/bash", "-c", ". /invoker-scripts/configureDNS.sh && /init.sh --uniqueName $INVOKER_NAME" ]
88-
{{- else }}
89-
command: [ "/bin/bash", "-c", "/init.sh --uniqueName $INVOKER_NAME" ]
94+
. /invoker-scripts/configureDNS.sh &&
9095
{{- end }}
96+
/init.sh --uniqueName $INVOKER_NAME
9197
env:
9298
- name: "PORT"
9399
value: {{ .Values.invoker.port | quote }}
@@ -202,6 +208,20 @@ spec:
202208
value: "{{ .Values.elasticsearch.password }}"
203209
- name: "CONFIG_whisk_spi_ActivationStoreProvider"
204210
value: "org.apache.openwhisk.core.database.elasticsearch.ElasticSearchActivationStoreProvider"
211+
{{- end }}
212+
{{- if ne .Values.docker.registry.name "" }}
213+
- name: "RUNTIMES_REGISTRY"
214+
value: "{{- .Values.docker.registry.name -}}"
215+
- name: "RUNTIMES_REGISTRY_USERNAME"
216+
valueFrom:
217+
secretKeyRef:
218+
name: {{ .Release.Name }}-docker.registry.auth
219+
key: docker_registry_username
220+
- name: "RUNTIMES_REGISTRY_PASSWORD"
221+
valueFrom:
222+
secretKeyRef:
223+
name: {{ .Release.Name }}-docker.registry.auth
224+
key: docker_registry_password
205225
{{- end }}
206226
ports:
207227
- name: invoker

0 commit comments

Comments
 (0)