UID & GID mapping in configuration doesn't work in Podman #115
Unanswered
darkcharmander
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I'm trying to get this image to run with Podman (with 'play kube'): this means that I'm storing my container configuration in a .yml file instead of directly running via cmd. I believe people sometimes call this k8 config files.
After some fiddling I got the container up and running, and I'm able to create/delete files! Well, what's the problem then? The problem is that Podman maps user IDs in containers to something random for security purposes. This is a problem, because the User ID that I've choosen in the configuration file, is ignored. Files now get random UIDs as owners, which is troublesome.
I've tried running Podman like this, but that just seems to destroy everything:
podman play kube --annotation io.podman.annotations.userns=keep-id:uid=1000,gid=1000 kubeconfig.yml
which results in tons of errors like this in the container:importas: fatal: unable to exec s6-setuidgid: Permission denied
I also tried some other stuff, like running as root (also breaks stuff completely) or seeing whether 'privileged' mode has any effect.
I know that this image is made for Docker, but I'm thinking that this should theoretically work in Podman as well. Right now I'm trying to run the container via another user (e.g. UID 1001) while another user (e.g. UID 1000) primarily connects to it. I also tried running the container as user ID 1000, but then you still get the random UIDs because of the user mappings.
I have no idea what I can do to fix this. Is what I'm trying to do even possible in Podman? I don't necessarily need a true multi-user setup, but at least the UIDs need to match up to the user on the host system.
Software setup
OS: Debian 13
Kernel: Linux 6.10.3
Podman: 5.0.3
Here is my kube (k8?) config file. I've omitted some irrelevant stuff.
And config.yml which is to be used under /data in the container.
Beta Was this translation helpful? Give feedback.
All reactions