Skip to content

Subpath volumes does not work with oc cluster up #21404

@jsafrane

Description

@jsafrane
Version

oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://127.0.0.1:8443
kubernetes v1.11.0+d4cacc0

Steps To Reproduce
  1. Install the cluster using oc cluster up
  2. Create a PVC and pod that uses the PVC with subpath:
$ oc create -f - <<EOF
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
    name: test
spec:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi

---
apiVersion: v1
kind: Pod
metadata:
    name: test
spec:
      containers:
      - name: test
        image: nginx
        volumeMounts:
        - mountPath: /home/user/test
          name: test
          subPath: test
      volumes:
      - name: test
        persistentVolumeClaim:
          claimName: test
EOF
Current Result

Pod does not start:

$ oc describe pod
...
  Warning  Failed     2s               kubelet, localhost  Error: failed to create subPath directory for volumeMount "test" of container "test"
Expected Result

Pod starts.

Additional Information

It must be something with containerized kubelet. In the logs I can see:

Nov 01 15:10:03 localhost.localdomain dockerd-current[5123]: E1101 15:10:03.569345    6152 kubelet_pods.go:198] failed to create subPath directory for volumeMount "test" of container "test": cannot create directory /rootfs/home/vagrant/openshift.local.clusterup/openshift.local.pv/pv0061/test: read-only file system

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.sig/master

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions