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 }}
{{- $envAll := . }}
{{- $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 }}
---
apiVersion: apps/v1
@ -53,13 +52,9 @@ spec:
initContainers:
- name: promenade-util
command:
{{- if and $mounts_init_container.volumeMounts $mounts_promenade_api.volumeMounts }}
{{- if $mounts_promenade_api.volumeMounts }}
- "cp"
{{- range $mounts_init_container.volumeMounts }}
{{- if eq "hyperkube" (index . "name") }}
- {{ index . "mountPath" | quote }}
{{- end }}
{{- end }}
- "/hyperkube"
{{- range $mounts_promenade_api.volumeMounts }}
{{- if eq "cache" (index . "name") }}
- {{ index . "mountPath" | quote }}
@ -68,10 +63,9 @@ spec:
{{- else }}
- "true"
{{- end }}
image: {{ .Values.images.tags.monitoring_image }}
image: {{ .Values.images.tags.hyperkube }}
imagePullPolicy: IfNotPresent
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 }}
containers:
- name: promenade-api
@ -127,6 +121,5 @@ spec:
configMap:
name: promenade-etc
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 }}
{{- end }}

View File

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