add initContainer to copy config from ConfigMap (#4169)

* Update statefulset.yaml

ConfigMaps are read-only since Kubernetes 1.9.4 (https://github.com/kubernetes/kubernetes/pull/58720). The rabbitmq-ha Chart uses a ConfigMap to provision /etc/rabbitmq. The official RabbitMQ docker image modifies these files in its docker-entrypoint.sh. This PR adds an initContainer to the StatefulSet to copy the configs from the ConfigMap to a new emptyDir volume.

* Update Chart.yaml

Bump version

* Update statefulset.yaml
This commit is contained in:
Stephan van Maris
2018-03-27 09:12:02 -07:00
committed by k8s-ci-robot
parent 86e1f83ab1
commit 37620d4306
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
name: rabbitmq-ha
apiVersion: v1
appVersion: 3.7.3
version: 1.0.2
version: 1.0.3
description: Highly available RabbitMQ cluster, the open source message broker
software that implements the Advanced Message Queuing Protocol (AMQP).
keywords:
@@ -24,6 +24,15 @@ spec:
spec:
terminationGracePeriodSeconds: 10
serviceAccountName: {{ template "rabbitmq-ha.serviceAccountName" . }}
initContainers:
- name: copy-rabbitmq-config
image: busybox
command: ['sh', '-c', 'cp /configmap/* /etc/rabbitmq']
volumeMounts:
- name: configmap
mountPath: /configmap
- name: config
mountPath: /etc/rabbitmq
containers:
- name: {{ .Chart.Name }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
@@ -154,6 +163,8 @@ spec:
{{- end }}
volumes:
- name: config
emptyDir: {}
- name: configmap
configMap:
name: {{ template "rabbitmq-ha.fullname" . }}
{{- if .Values.rabbitmqCert.enabled }}