-
Notifications
You must be signed in to change notification settings - Fork 275
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
Init container runs as root #357
Comments
Running |
On a second thought, we may consider making this an optional feature. I can see asking users to always grant the operator with a PSP of root access problematic and unnecessary for people not on Openshift. Thoughts? @Zerpet @mkuratczyk |
I thought the Pod Security Context Does the Pod Security Context work on Open Shift? If it doesn't then perhaps the OpenShift equivalent needs to be configured? |
The pod security context The docs state that the volume ownership is only changed for some volume types. (kubernetes/examples#260 is another example where |
ContextThe |
Hi Team, Not sure how to proceed now, seems like this is a design choice. I have a cluster that enforces PSP with the restricted policy. That means, I cannot run any pod with the root user.
Does this mean I cannot use the operator to deploy the cluster? Is there no work around to this? |
I'm having the same issue as @NerdSec but on AKS. We have policy that enforces no root users, read only root file system and no privilege escalation. I need guidance. |
@irperez I ended up using the bitnami helm chart to get an HA deployment for rabbitmq working. It is working fine for me, and have faced no issues so far. |
Hey folks, thanks for raising this up. We will revisit this and try to improve the situation. |
Just to keep this up to date: we are looking into this, hence the linked PR. We're just double checking that such a change doesn't affect Openshift users. In the meantime, one workaround would be to use the override feature to manually set the user of the initContainer to non-root: apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: non-root
spec:
override:
statefulSet:
spec:
template:
spec:
containers: []
initContainers:
- name: setup-container
securityContext:
runAsUser: 999
runAsGroup: 999 |
@NerdSec @irperez @raviranjanelastisys Just to keep you in the loop: we did some testing of this today. We were concerned about the effect this would have on Openshift clusters, however it seems that we are able to spin up clusters without root successfully, so we have merged the PR. This is available in the latest commit to |
Creating a
RabbitmqCluster
in a cluster with Pod Security Policies enabled that disable to run as root result in the Podsnot being created because the init container tries to run as root.
Snippet of the events in the StatefulSet:
We should verify if there is any requirements to run as root in the init container and adapt the security context
accordingly. If it is strictly necessary to run as root in the init container, we should document this.
This was tested with Cluster Operator 0.46.0.
The text was updated successfully, but these errors were encountered: