nestybox / nestybox/sysbox

k8s: root cannot chown in emptyDir volume mount

Open
#554 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
3.9k
Forks
230
Avg merge
7h 48m
Merged PRs (30d)
3

Description

Maybe this is expected, but I'm facing workloads that are failing under sysbox because root can't change the owner of files and directories in a shared volume mount.

Create my pod:

apiVersion: v1
kind: Pod
metadata:
  name: sysbox-test
  namespace: default
  annotations:
    io.kubernetes.cri-o.userns-mode: "auto:size=65536"
spec:
  runtimeClassName: sysbox-runc
  containers:
    - name: ubu-bio-systemd-docker
      image: registry.nestybox.com/nestybox/ubuntu-bionic-systemd-docker
      command: ["/sbin/init"]
      volumeMounts:
        - mountPath: /tmp/share
          name: share
    - name: foo
      image: ubuntu
      command: ["/bin/sleep", "180"]
      securityContext:
        runAsUser: 999
        runAsGroup: 999
      volumeMounts:
        - mountPath: /tmp/share
          name: share
  securityContext:
    fsGroup: 999

  restartPolicy: Always
  volumes:
    - name: share
      emptyDir:
        medium: Memory

Then from the shell on the system container:

kubectl exec -it sysbox-test -- /bin/bash

root@sysbox-test:/# mkdir /tmp/share/foo
root@sysbox-test:/# ls -lhd /tmp/share/foo/
drwxr-sr-x 2 root nogroup 40 May 25 18:20 /tmp/share/foo/
root@sysbox-test:/# chown 999:999 /tmp/share/foo/
chown: changing ownership of '/tmp/share/foo/': Operation not permitted

I can workaround, but this works without sysbox.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Kubernetes pod manifest and reproduce the failure using the kubectl exec commands. Trace how sysbox handles emptyDir shared-volume ownership changes and compare the behavior with and without sysbox. Done means root can chown files and directories in the shared emptyDir mount without the reported Operation not permitted error.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.