Skip to content

Commit

Permalink
Make busybox image configurable (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng authored and dgrove-oss committed Nov 19, 2020
1 parent 14de4f8 commit 0e2d41b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions helm/openwhisk/templates/_readiness.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# if not db.wipeAndInit, the external db must already be ready; so no need for init container
{{- else -}}
- name: "wait-for-couchdb"
image: "{{- .Values.docker.registry.name -}}busybox"
image: "{{- .Values.docker.registry.name -}}{{- .Values.busybox.imageName -}}:{{- .Values.busybox.imageTag -}}"
imagePullPolicy: "IfNotPresent"
env:
- name: "READINESS_URL"
Expand All @@ -33,7 +33,7 @@
{{/* Init container that waits for kafka to be ready */}}
{{- define "openwhisk.readiness.waitForKafka" -}}
- name: "wait-for-kafka"
image: "{{- .Values.docker.registry.name -}}busybox"
image: "{{- .Values.docker.registry.name -}}{{- .Values.busybox.imageName -}}:{{- .Values.busybox.imageTag -}}"
imagePullPolicy: "IfNotPresent"
# TODO: I haven't found an easy external test to determine that kafka is up, so as a hack we wait for zookeeper and then sleep for 10 seconds and cross our fingers!
command: ["sh", "-c", 'result=1; until [ $result -eq 0 ]; do OK=$(echo ruok | nc -w 1 {{ include "openwhisk.zookeeper_zero_host" . }} {{ .Values.zookeeper.port }}); if [ "$OK" == "imok" ]; then result=0; echo "zookeeper returned imok!"; else echo waiting for zookeeper to be ready; sleep 1; fi done; echo "Zookeeper is up; will wait for 10 seconds to give kafka time to initialize"; sleep 10;']
Expand All @@ -42,15 +42,15 @@
{{/* Init container that waits for zookeeper to be ready */}}
{{- define "openwhisk.readiness.waitForZookeeper" -}}
- name: "wait-for-zookeeper"
image: "{{- .Values.docker.registry.name -}}busybox"
image: "{{- .Values.docker.registry.name -}}{{- .Values.busybox.imageName -}}:{{- .Values.busybox.imageTag -}}"
imagePullPolicy: "IfNotPresent"
command: ["sh", "-c", 'result=1; until [ $result -eq 0 ]; do OK=$(echo ruok | nc -w 1 {{ include "openwhisk.zookeeper_zero_host" . }} {{ .Values.zookeeper.port }}); if [ "$OK" == "imok" ]; then result=0; echo "zookeeper returned imok!"; else echo waiting for zookeeper to be ready; sleep 1; fi; done; echo "Success: zookeeper is up"']
{{- end -}}

{{/* Init container that waits for controller to be ready */}}
{{- define "openwhisk.readiness.waitForController" -}}
- name: "wait-for-controller"
image: "{{- .Values.docker.registry.name -}}busybox"
image: "{{- .Values.docker.registry.name -}}{{- .Values.busybox.imageName -}}:{{- .Values.busybox.imageTag -}}"
imagePullPolicy: "IfNotPresent"
env:
- name: "READINESS_URL"
Expand All @@ -61,7 +61,7 @@
{{/* Init container that waits for at least 1 healthy invoker */}}
{{- define "openwhisk.readiness.waitForHealthyInvoker" -}}
- name: "wait-for-healthy-invoker"
image: "{{- .Values.docker.registry.name -}}busybox"
image: "{{- .Values.docker.registry.name -}}{{- .Values.busybox.imageName -}}:{{- .Values.busybox.imageTag -}}"
imagePullPolicy: "IfNotPresent"
env:
- name: "READINESS_URL"
Expand All @@ -72,7 +72,7 @@
{{/* Init container that waits for ElasticSearch to be ready */}}
{{- define "openwhisk.readiness.waitForElasticSearch" -}}
- name: "wait-for-elasticsearch"
image: "{{- .Values.docker.registry.name -}}busybox"
image: "{{- .Values.docker.registry.name -}}{{- .Values.busybox.imageName -}}:{{- .Values.busybox.imageTag -}}"
imagePullPolicy: "IfNotPresent"
env:
- name: "READINESS_URL"
Expand Down
2 changes: 1 addition & 1 deletion helm/openwhisk/templates/redis-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
{{- if .Values.k8s.persistence.enabled }}
initContainers:
- name: redis-init
image: "{{- .Values.docker.registry.name -}}busybox"
image: "{{- .Values.docker.registry.name -}}{{- .Values.busybox.imageName -}}:{{- .Values.busybox.imageTag -}}"
command:
- chown
- -v
Expand Down
4 changes: 4 additions & 0 deletions helm/openwhisk/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ providers:
apiPort: 8080
dbPrefix: "kp"

busybox:
imageName: "busybox"
imageTag: "latest"


# Used to define pod affinity and anti-affinity for the Kubernetes scheduler.
# If affinity.enabled is true, then all of the deployments for the OpenWhisk
Expand Down

0 comments on commit 0e2d41b

Please sign in to comment.