Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
deploy: work around read-only /sys
Browse files Browse the repository at this point in the history
Depending on the cluster configuration (seen on OpenShift 4.5,
Kubernetes 1.18.3, cri-o 1.18.3), /sys is mounted read-only although a
read/write mount gets requested.

The theory is that some component does something special for /sys, so
hopefully asking for it to be mounted also under /host-sys and then
bind-mounting inside the container will work around that.

We need /host-sys because the special sysfs that normally can be
mounted directly does not exist inside the container. An attempt to do
that simpler approach failed:

pmem-csi-intel-com-node-n992g/pmem-driver@pmem..ker2: Mounting command: mount
pmem-csi-intel-com-node-n992g/pmem-driver@pmem..ker2: Mounting arguments:  -o rw,seclabel,nosuid,nodev,noexec,relatime sysfs /sys
pmem-csi-intel-com-node-n992g/pmem-driver@pmem..ker2: Output: mount: /sys: special device sysfs does not exist.
  • Loading branch information
pohly committed Mar 1, 2021
1 parent 0d74110 commit 7a5b879
Show file tree
Hide file tree
Showing 44 changed files with 166 additions and 30 deletions.
44 changes: 22 additions & 22 deletions deploy/bindata_generated.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions deploy/kubernetes-1.17/direct/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.17/direct/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.17/lvm/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.17/lvm/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.17/pmem-csi-direct-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.17/pmem-csi-direct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.17/pmem-csi-lvm-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.17/pmem-csi-lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/direct/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/direct/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/lvm/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/lvm/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/pmem-csi-direct-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/pmem-csi-direct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/pmem-csi-lvm-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.18/pmem-csi-lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19-alpha/direct/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19-alpha/direct/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19-alpha/lvm/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19-alpha/lvm/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19-alpha/pmem-csi-direct-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19-alpha/pmem-csi-direct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19-alpha/pmem-csi-lvm-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19-alpha/pmem-csi-lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19/direct/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19/direct/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19/lvm/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19/lvm/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19/pmem-csi-direct-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19/pmem-csi-direct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19/pmem-csi-lvm-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.19/pmem-csi-lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/direct/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/direct/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/lvm/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/lvm/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/pmem-csi-direct-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/pmem-csi-direct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/pmem-csi-lvm-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes-1.20/pmem-csi-lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ spec:
name: dev-dir
- mountPath: /sys
name: sys-dir
- mountPath: /host-sys
name: sys-dir
- mountPath: /csi
name: socket-dir
- mountPath: /var/lib/pmem-csi.intel.com
Expand Down
10 changes: 10 additions & 0 deletions deploy/kustomize/driver/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ spec:
mountPath: /dev
- name: sys-dir
mountPath: /sys
# We also mount the host's /sys into the container under a different path
# than /sys because on OpenShift 4.5, the mount at /sys became read-only:
# - https://github.com/intel/pmem-csi/issues/786
# - https://github.com/containerd/containerd/issues/3221
#
# The pmem-csi-driver binary will bind-mount /host-sys onto /sys
# when it detects that problem to ensure that libndctl works without
# modifications.
- name: sys-dir
mountPath: /host-sys
- name: socket-dir
mountPath: /csi
- name: pmem-state-dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,10 @@ func (d *pmemCSIDeployment) getNodeDriverContainer() corev1.Container {
Name: "sys-dir",
MountPath: "/sys",
},
{
Name: "sys-dir",
MountPath: "/host-sys",
},
{
Name: "socket-dir",
MountPath: "/csi",
Expand Down
Loading

0 comments on commit 7a5b879

Please sign in to comment.