From 4e1bf7971e788f4f809006226715c97b2ca34f2b Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Thu, 26 Mar 2020 16:20:21 -0400 Subject: [PATCH] stx-monitor logstash template change Default to using the same image as the main container in logstash extra init containers so that the same docker registry as the main container image can be used. Closes-Bug: 1869256 Change-Id: I0555c31208f25146ba74b1a7b2f926abaf31e060 Signed-off-by: Kevin Smith --- monitor-helm/centos/monitor-helm.spec | 2 + ...in-container-image-for-initcontainer.patch | 44 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 monitor-helm/files/0016-use-main-container-image-for-initcontainer.patch diff --git a/monitor-helm/centos/monitor-helm.spec b/monitor-helm/centos/monitor-helm.spec index 357413c..8ea72ce 100644 --- a/monitor-helm/centos/monitor-helm.spec +++ b/monitor-helm/centos/monitor-helm.spec @@ -33,6 +33,7 @@ Patch12: 0012-Add-imagePullSecrets.patch Patch13: 0013-removed-unused-images.patch Patch14: 0014-Add-rbac-replicasets-to-apps-apigroup-commit-1717e2d.patch Patch15: 0015-script-flexibility.patch +Patch16: 0016-use-main-container-image-for-initcontainer.patch BuildRequires: helm @@ -56,6 +57,7 @@ Monitor Helm charts %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p1 %build # initialize helm and build the toolkit diff --git a/monitor-helm/files/0016-use-main-container-image-for-initcontainer.patch b/monitor-helm/files/0016-use-main-container-image-for-initcontainer.patch new file mode 100644 index 0000000..d051d5b --- /dev/null +++ b/monitor-helm/files/0016-use-main-container-image-for-initcontainer.patch @@ -0,0 +1,44 @@ +From 1e1ee29b195958f0c3313af86b6dae8f04720277 Mon Sep 17 00:00:00 2001 +From: Kevin Smith +Date: Thu, 26 Mar 2020 15:01:07 -0400 +Subject: [PATCH 1/1] use main container image for initcontainer + +--- + stable/logstash/templates/statefulset.yaml | 4 ++++ + stable/logstash/values.yaml | 5 +++++ + 2 files changed, 9 insertions(+) + +diff --git a/stable/logstash/templates/statefulset.yaml b/stable/logstash/templates/statefulset.yaml +index d34dcec..66f6313 100644 +--- a/stable/logstash/templates/statefulset.yaml ++++ b/stable/logstash/templates/statefulset.yaml +@@ -48,6 +48,10 @@ spec: + initContainers: + {{- if .Values.extraInitContainers }} + {{ toYaml .Values.extraInitContainers | indent 8 }} ++{{- if .Values.useMainImageForInitContainers }} ++ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ++ imagePullPolicy: {{ .Values.image.pullPolicy }} ++{{- end }} + env: + ## Elasticsearch output + - name: ELASTICSEARCH_HOST +diff --git a/stable/logstash/values.yaml b/stable/logstash/values.yaml +index 2fdebde..2167601 100644 +--- a/stable/logstash/values.yaml ++++ b/stable/logstash/values.yaml +@@ -169,6 +169,11 @@ volumes: [] + + extraEnv: [] + ++# Init container will use the same image as the main ++# container if this is true. If true, do not specify ++# the image in the extraInitContainers block. If false, ++# will need to specify the image. ++useMainImageForInitContainers: true + extraInitContainers: [] + # - name: echo + # image: busybox +-- +1.8.3.1 +