-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mnesia permissions in PV #501
Conversation
Hi @wbagdon, thanks for using the operator. We have seen related problems in other environment. Our suspicion is that we mount I've updated the mount order and pushed the changes as a dev image. Could you test this operator image: |
Thanks for taking a look at this @ChunyiLyu I tried using the image you provided in the operator but I'm still having the same permissions issue when creating the hello world cluster. Here's what I did in case I missed a step:
Error is the same:
|
@wbagdon I see. Sorry that the fix didn't fix the issue you are facing. This could be an infrastructure related issue as we have never seen this deploy error when testing on other k8s provider. Before the team decide to accept the fix or not. I suggest that you leverage our statefulset override for now to verify that this is indeed a fix for you and to deploy. You can use the statefulSet override to patch the statefulSet definition whichever way that suits your use case. For example, you can try to override the initContainer commands like
I hope this helps :) |
Yes, I was able to get the cluster running using the override spec: apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: cluster-dev
spec:
service:
type: NodePort
override:
statefulSet:
spec:
template:
spec:
containers: []
initContainers:
- name: setup-container
command:
- sh
- -c
- cp /tmp/erlang-cookie-secret/.erlang.cookie /var/lib/rabbitmq/.erlang.cookie
&& chown 999:999 /var/lib/rabbitmq/.erlang.cookie
&& chmod 600 /var/lib/rabbitmq/.erlang.cookie ;
cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins
&& chown 999:999 /operator/enabled_plugins ;
chown 999:999 /var/lib/rabbitmq/mnesia/ ;
echo '[default]' > /var/lib/rabbitmq/.rabbitmqadmin.conf
&& sed -e 's/default_user/username/' -e 's/default_pass/password/' /tmp/default_user.conf >> /var/lib/rabbitmq/.rabbitmqadmin.conf
&& chown 999:999 /var/lib/rabbitmq/.rabbitmqadmin.conf
&& chmod 600 /var/lib/rabbitmq/.rabbitmqadmin.conf |
The unit test is broken because of the PR. Could you fix the test and clean up the branch history? I will merge the PR after that 😄 You can run the unit test by cd in the repo and run Thanks for contributing! |
Thanks for the assist on the unit test, I believe everything is as requested. |
@wbagdon merged and thanks for contributing 😃 |
Note to reviewers: remember to look at the commits in this PR and consider if they can be squashed
Summary Of Changes
Sets the UID on /var/lib/rabbitmq/mnesia/
Additional Context
Clusters fail to start on Rancher 2.5.2 Kubernetes 1.19.3 using vSphere CSI with the following error:
Setting the UID allows the pod to write to the PV
Local Testing
Please ensure you run the unit, integration and system tests before approving the PR.
To run the unit and integration tests:
You will need to target a k8s cluster and have the operator deployed for running the system tests.
For example, for a Kubernetes context named
dev-bunny
: