Skip to content
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

ci: run rabbitmq as non-root#7362

Conversation

jennifer-richards
Copy link
Member

Sets securityContexts for the rabbitmq pod so it does not run as root.

This creates a permissions issue with the rabbitmq-data volume, which is mounted at /var/lib/rabbitmq. The permissions on that volume require root, at least with the hostPath driver I use in my dev testing. I tried using fsGroup in the pod seurityContext to fix this but that does not seem to work with hostPath. While it might work for production use, I've instead added an initContainer to create a subdirectory in the rabbitmq-data volume with the necessary permissions, then mount this via subPath at /var/lib/rabbitmq.

Needed since rootfs is now read-only
Rabbitmq needs to be able to write to the fs at
/var/lib/rabbitmq. It may be possible to get rid
of the initContainer and use fsGroup in the pod
securityContext to manage this, but that does not
work for the hostVolume mounts I use for dev.
The solution here moves the actual mount to the
rabbitmq/ directory in the rabbitmq-data volume
and uses an initContainer to set the permissions
on that. That should work for any volume type.
@jennifer-richards jennifer-richards merged commit ea65599 into ietf-tools:feat/helm Apr 24, 2024
2 checks passed
@jennifer-richards jennifer-richards deleted the silly-rabbitmq-root-is-for-kids branch April 24, 2024 23:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants