-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
securityContext.fsGroup #17583
Comments
I agree that support for apiVersion: v1
kind: Pod
metadata:
name: idmapped-mounts-test
spec:
containers:
- name: idmapped-mounts-test
image: "registry.fedoraproject.org/fedora:37"
volumeMounts:
- mountPath: "/etc/letsencrypt:idmap"
name: test-mount Additionally you might specify that the idmapping should be relative to the container user namespace in case you use auto user namespaces. apiVersion: v1
kind: Pod
metadata:
name: idmapped-mounts-test
spec:
containers:
- name: idmapped-mounts-test
image: "registry.fedoraproject.org/fedora:37"
volumeMounts:
- mountPath: "/etc/letsencrypt:idmap=uids=@0-1001-1;gids=@0-1001-1"
name: test-mount
Unfortunately the relative idmapping is broken in 4.4.0+, but should be fixed in the next bugifx release (see #17517). |
Thank you for the info. I also found a way to access the files which is easier for me to use. |
A friendly reminder that this issue had no activity for 30 days. |
/remove stale |
@giuseppe @umohnani8 WDYT? |
Hi @MartinX3 are you requesting support for this in |
I would really like Here's a minimal example. apiVersion: v1
kind: Pod
metadata:
name: test
spec:
containers:
- name: test
image: cgr.dev/chainguard/busybox
command: ["/bin/busybox"]
args: ["sleep", "infinity"]
volumeMounts:
- name: test
mountPath: /home/nonroot/.local/share/database.sqlite
securityContext:
fsGroup: 65532
volumes:
- name: test
hostPath:
path: ./database.sqlite
type: File $ touch database.sqlite
$ podman kube play pod.yaml
$ podman exec test-test /bin/busybox ls -la /home/nonroot Current output:
Expected output:
|
@AhmedGrati You got it. |
and updates? |
Feature request description
https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
Change recursively the ownership of the mounted (readonly) volume only for the mounting pod.
Suggest potential solution
There is none.
We can't change the ownership of a mounted read only volume to get read access.
Have you considered any alternatives?
Mounting as R/W and change the ownership via
chown
would change the ownership ID for every pod mounting the volume.Additional context
Kubernetes supports it.
I need it to backup the volumes of several pods in a central borgmatic container.
The text was updated successfully, but these errors were encountered: