hyperkube image in promenade init

Use hyperkube image for promenade init container.
It's purpose is to extract and cache hyperkube binary from image.
This binary will be used in promenade-api container as a backup plan.

Init container stores binary in a shared volume where
promenade-api container can use it. It will use it when
promenade config has no docker endpoint to call docker API
from promenade source code.

See https://review.opendev.org/657953 for reference.

Change-Id: I7edcb1acbe0d864324a4341c682bbcb9b110c4eb
This commit is contained in:
Egorov, Stanislav (se6518) 2019-06-20 09:50:15 -07:00
parent fe60268244
commit 32a6c15ffd
2 changed files with 4 additions and 19 deletions

View File

@ -17,7 +17,6 @@ limitations under the License.
{{- if .Values.manifests.deployment_api }} {{- if .Values.manifests.deployment_api }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $labels := tuple $envAll "promenade" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" -}} {{- $labels := tuple $envAll "promenade" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" -}}
{{- $mounts_init_container := .Values.pod.mounts.promenade_api.init_container }}
{{- $mounts_promenade_api := .Values.pod.mounts.promenade_api.promenade_api }} {{- $mounts_promenade_api := .Values.pod.mounts.promenade_api.promenade_api }}
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
@ -53,13 +52,9 @@ spec:
initContainers: initContainers:
- name: promenade-util - name: promenade-util
command: command:
{{- if and $mounts_init_container.volumeMounts $mounts_promenade_api.volumeMounts }} {{- if $mounts_promenade_api.volumeMounts }}
- "cp" - "cp"
{{- range $mounts_init_container.volumeMounts }} - "/hyperkube"
{{- if eq "hyperkube" (index . "name") }}
- {{ index . "mountPath" | quote }}
{{- end }}
{{- end }}
{{- range $mounts_promenade_api.volumeMounts }} {{- range $mounts_promenade_api.volumeMounts }}
{{- if eq "cache" (index . "name") }} {{- if eq "cache" (index . "name") }}
- {{ index . "mountPath" | quote }} - {{ index . "mountPath" | quote }}
@ -68,10 +63,9 @@ spec:
{{- else }} {{- else }}
- "true" - "true"
{{- end }} {{- end }}
image: {{ .Values.images.tags.monitoring_image }} image: {{ .Values.images.tags.hyperkube }}
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
volumeMounts: volumeMounts:
{{ if $mounts_init_container.volumeMounts }}{{ toYaml $mounts_init_container.volumeMounts | indent 8 }}{{ end }}
{{ if $mounts_promenade_api.volumeMounts }}{{ toYaml $mounts_promenade_api.volumeMounts | indent 8 }}{{ end }} {{ if $mounts_promenade_api.volumeMounts }}{{ toYaml $mounts_promenade_api.volumeMounts | indent 8 }}{{ end }}
containers: containers:
- name: promenade-api - name: promenade-api
@ -127,6 +121,5 @@ spec:
configMap: configMap:
name: promenade-etc name: promenade-etc
defaultMode: 0444 defaultMode: 0444
{{ if $mounts_init_container.volumes }}{{ toYaml $mounts_init_container.volumes | indent 8 }}{{ end }}
{{ if $mounts_promenade_api.volumes }}{{ toYaml $mounts_promenade_api.volumes | indent 8 }}{{ end }} {{ if $mounts_promenade_api.volumes }}{{ toYaml $mounts_promenade_api.volumes | indent 8 }}{{ end }}
{{- end }} {{- end }}

View File

@ -44,6 +44,7 @@ conf:
images: images:
tags: tags:
monitoring_image: busybox:1.28.3 monitoring_image: busybox:1.28.3
hyperkube: gcr.io/google_containers/hyperkube-amd64:v1.11.6
promenade: quay.io/airshipit/promenade:latest promenade: quay.io/airshipit/promenade:latest
ks_user: docker.io/openstackhelm/heat:newton ks_user: docker.io/openstackhelm/heat:newton
ks_service: docker.io/openstackhelm/heat:newton ks_service: docker.io/openstackhelm/heat:newton
@ -177,15 +178,6 @@ pod:
mounts: mounts:
promenade_api: promenade_api:
test_container: null test_container: null
init_container:
volumeMounts:
- name: hyperkube
mountPath: /hyperkube
volumes:
- name: hyperkube
hostPath:
path: /opt/kubernetes/bin/hyperkube
type: File
promenade_api: promenade_api:
volumeMounts: volumeMounts:
- name: cache - name: cache