Skip to content

ci: run rabbitmq as non-root - #7362

Merged
jennifer-richards merged 4 commits into
ietf-tools:feat/helmfrom
jennifer-richards:silly-rabbitmq-root-is-for-kids
Apr 24, 2024
Merged

ci: run rabbitmq as non-root#7362
jennifer-richards merged 4 commits into
ietf-tools:feat/helmfrom
jennifer-richards:silly-rabbitmq-root-is-for-kids

Conversation

@jennifer-richards

Copy link
Copy Markdown
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
@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.

2 participants