From 32a6c15ffd6c283375bfd1cc9ae82f9232a9b501 Mon Sep 17 00:00:00 2001 From: "Egorov, Stanislav (se6518)" Date: Thu, 20 Jun 2019 09:50:15 -0700 Subject: [PATCH] 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 --- charts/promenade/templates/deployment-api.yaml | 13 +++---------- charts/promenade/values.yaml | 10 +--------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/charts/promenade/templates/deployment-api.yaml b/charts/promenade/templates/deployment-api.yaml index 2c0f1ffb..e4b5374d 100644 --- a/charts/promenade/templates/deployment-api.yaml +++ b/charts/promenade/templates/deployment-api.yaml @@ -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 }} diff --git a/charts/promenade/values.yaml b/charts/promenade/values.yaml index 2d6ef375..4a3e2ad8 100644 --- a/charts/promenade/values.yaml +++ b/charts/promenade/values.yaml @@ -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