Kubernetes version: 1.21
Cloud being used: bare-metal
Installation method: kubeadm
Host OS: Ubuntu 20.02
CNI and version: Calico
CRI and version: containerd
Is it possible to mount a persistent volume as a user? I know that you can use
fsGroup, but what if there is no group that matches the user id?
I’m trying to setup Keycloak with a persistent volume for my thems at
/opt/jboss/keycloak/themes but it mounts as root:root. The image is built to run as
jboss with the user id of 1000, but a group was not created for
jboss. Since it runs as jboss, I can’t run
chown because the permissions won’t allow it. I’ve tried using fsGroup but it isn’t working. I assume this is because there is no group that matches the user id.
This is the setup from RedHat:
echo “jboss:x:0:root” >> /etc/group
echo “jboss:x:1000:0:JBoss user:/opt/jboss:/sbin/nologin” >> /etc/passwd
chown -R jboss:root /opt/jboss
chmod -R g+rwX /opt/jboss
Do I have any options outside of building the image myself?