Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

add initContainer to copy config from ConfigMap #4169

Merged
merged 3 commits into from
Mar 27, 2018
Merged

add initContainer to copy config from ConfigMap #4169

merged 3 commits into from
Mar 27, 2018

Conversation

svmaris
Copy link
Contributor

@svmaris svmaris commented Mar 15, 2018

What this PR does / why we need it:

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#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 that copies the files from the ConfigMap to a new emptyDir.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #4166

Special notes for your reviewer:

@etiennetremel

Stephan van Maris added 3 commits March 15, 2018 22:56
ConfigMaps are read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#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.
Bump version
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 15, 2018
@svmaris svmaris changed the title fix for #4166 add initContainer to copy config from ConfigMap Mar 15, 2018
@brianwawok
Copy link

@svmaris your change is not working for me

I see

warning: /var/lib/rabbitmq/.erlang.cookie contents do not match RABBITMQ_ERLANG_COOKIE

=ERROR REPORT==== 17-Mar-2018::16:37:42 ===
** Connection attempt from disallowed node 'rabbitmqcli61@rabbitmq-ha-rabbitmq-ha-0.rabbitmq-ha-rabbitmq-ha.default.svc.cluster.local' **

@etiennetremel
Copy link
Contributor

@brianwawok as mentioned in the README.md, you need to keep the same erlang cookie configuration between upgrade:

$ export ERLANGCOOKIE=$(kubectl get secrets -n <NAMESPACE> <HELM_RELEASE_NAME>-rabbitmq-ha -o jsonpath="{.data.rabbitmq-erlang-cookie}" | base64 --decode)
$ helm upgrade --name <HELM_RELEASE_NAME> \
    --set rabbitmqErlangCookie=$ERLANGCOOKIE \
    stable/rabbitmq-ha

@brianwawok
Copy link

@etiennetremel okay.. I was getting even on a helm delete --purge, followed by a helm install.

I ended up just dumping everything to file with helm template, and this fix appears to work, so happy to chalk it up to user error or a bug in helm purge..

@hiddeco
Copy link
Contributor

hiddeco commented Mar 17, 2018

We were experiencing the same issues as described above using the same ERLANGCOOKIE as the previous deployments.

After a helm delete <name> - -purge and helm install all pods were deployed successfully. Pods do however fail to reconnect to the cluster when they're killed.

I am almost certain these issues are not the result of the changes in this PR but due to unforseen changes in Kubernetes or RabbitMQ itself.

Update (18 Mar 10PM CET): after 500 restart attempts the reconnect came through this morning. Killed the pod again and it landed almost instantly in a CrashLoopBackoff.

DIAGNOSTICS
===========

attempted to contact: ['rabbit@10.44.0.37']

rabbit@10.44.0.37:
  * connected to epmd (port 4369) on 10.44.0.37
  * epmd reports: node 'rabbit' not running at all
                  other nodes on 10.44.0.37: [rabbitmqcli99]
  * suggestion: start the node

Current node details:
 * node name: 'rabbitmqcli99@<snip>.svc.cluster.local'
 * effective user's home directory: /var/lib/rabbitmq
 * Erlang cookie hash: <snip>
  Warning  FailedSync  3m (x99 over 44m)  kubelet, <snip>-89ce862a-1z01  Error syncing pod

Failing pod is not logging anything to stdout and stale for +- 5 minutes before a restart happens.

@jjlakis
Copy link

jjlakis commented Mar 23, 2018

Works for me

@unguiculus
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 26, 2018
@unguiculus
Copy link
Member

/assign

@unguiculus
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: svmaris, unguiculus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 27, 2018
@k8s-ci-robot k8s-ci-robot merged commit 37620d4 into helm:master Mar 27, 2018
k8s-ci-robot pushed a commit that referenced this pull request Mar 29, 2018
…figMap to an EmptyDir (#4271)

* Update deployment.yaml

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#58720). The Grafana Chart uses a ConfigMap to provision the config- and dashboard directories. Grafana tries to create/modify files in these directories, which is not allowed anymore. This PR adds an busybox initContainer to the Deployment that copies the files from the ConfigMap to a new emptyDir, similar to #4169. Fixes #4267.

* bump Chart version
rolanddb pushed a commit to Eneco/charts that referenced this pull request Apr 9, 2018
* Update statefulset.yaml

ConfigMaps are read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#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
rolanddb pushed a commit to Eneco/charts that referenced this pull request Apr 9, 2018
…figMap to an EmptyDir (helm#4271)

* Update deployment.yaml

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#58720). The Grafana Chart uses a ConfigMap to provision the config- and dashboard directories. Grafana tries to create/modify files in these directories, which is not allowed anymore. This PR adds an busybox initContainer to the Deployment that copies the files from the ConfigMap to a new emptyDir, similar to helm#4169. Fixes helm#4267.

* bump Chart version
ichtar pushed a commit to Bestmile/charts that referenced this pull request May 15, 2018
* Update statefulset.yaml

ConfigMaps are read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#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
ichtar pushed a commit to Bestmile/charts that referenced this pull request May 15, 2018
…figMap to an EmptyDir (helm#4271)

* Update deployment.yaml

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#58720). The Grafana Chart uses a ConfigMap to provision the config- and dashboard directories. Grafana tries to create/modify files in these directories, which is not allowed anymore. This PR adds an busybox initContainer to the Deployment that copies the files from the ConfigMap to a new emptyDir, similar to helm#4169. Fixes helm#4267.

* bump Chart version
voron pushed a commit to dysnix/helm-charts that referenced this pull request Sep 5, 2018
* Update statefulset.yaml

ConfigMaps are read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#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

Signed-off-by: voron <av@arilot.com>
voron pushed a commit to dysnix/helm-charts that referenced this pull request Sep 5, 2018
…figMap to an EmptyDir (helm#4271)

* Update deployment.yaml

ConfigMaps are mounted read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#58720). The Grafana Chart uses a ConfigMap to provision the config- and dashboard directories. Grafana tries to create/modify files in these directories, which is not allowed anymore. This PR adds an busybox initContainer to the Deployment that copies the files from the ConfigMap to a new emptyDir, similar to helm#4169. Fixes helm#4267.

* bump Chart version

Signed-off-by: voron <av@arilot.com>
gochist pushed a commit to gochist/charts that referenced this pull request Mar 27, 2019
* Update statefulset.yaml

ConfigMaps are read-only since Kubernetes 1.9.4 (kubernetes/kubernetes#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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: rabbitmq-ha chart fails to deploy on K8S 1.9.4 due to ConfigMaps now being mounted RO
7 participants