IBM / ibm-object-csi-driver

Object storage plugin for IBM satellite
Apache License 2.0
3 stars 8 forks source link

Fix waitForMount method #45

Open minbaev opened 2 years ago

minbaev commented 2 years ago

driver fails producing only a known no-harm error from linux-mounter pckeage if waiting for mount is enabled

I0927 13:54:36.900413       1 mount_linux.go:202] Cannot run systemd-run, assuming non-systemd OS
I0927 13:54:36.900433       1 mount_linux.go:203] systemd-run output: System has not been booted with systemd as init system (PID 1). Can't operate1

temp fix is to comment out call to the method https://github.com/IBM/satellite-object-storage-plugin/blob/main/pkg/mounter/mounter.go#L53

ambiknai commented 2 years ago

Actual error when mount point doesnt exist

I1021 04:55:24.204564       1 nodeserver.go:264] Output: Output string error mountpoint: /var/data/kubelet/pods/a3c4dee5-ab87-4abf-93f7-db3802fa0ce1/volumes/kubernetes.io~csi/pvc-917efa96-ed15-475f-bbe6-48578720a70c/mount: No such file or directory
E1021 04:55:24.204597       1 nodeserver.go:126] Can not validate target mount point: /var/data/kubelet/pods/a3c4dee5-ab87-4abf-93f7-db3802fa0ce1/volumes/kubernetes.io~csi/pvc-917efa96-ed15-475f-bbe6-48578720a70c/mount exit status 1
E1021 04:55:24.204609       1 server.go:155] GRPC error: rpc error: code = Internal desc = exit status 1

Test Results

➜  csi-object oc get pods                                                                 
NAME                      READY   STATUS    RESTARTS   AGE
cos-csi-app               1/1     Running   0          6m33s
cos-s3-csi-attacher-0     1/1     Running   0          7m42s
cos-s3-csi-controller-0   2/2     Running   0          7m41s
cos-s3-csi-driver-bcl6m   2/2     Running   0          8m15s
cos-s3-csi-driver-rdqqr   2/2     Running   0          8m16s
cos-s3-csi-driver-wxldt   2/2     Running   0          94s
➜  csi-object oc exec -it cos-csi-app /bin/bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
root@cos-csi-app:/# mount | grep s3fs
s3fs on /data type fuse.s3fs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
root@cos-csi-app:/# ls /data
root@cos-csi-app:/# cd /data
root@cos-csi-app:/data# echo "test mount" > new.txt
root@cos-csi-app:/data# exit
exit
➜  csi-object oc get pods
oc delete pods NAME                      READY   STATUS    RESTARTS   AGE
cos-csi-app               1/1     Running   0          10m
cos-s3-csi-attacher-0     1/1     Running   0          11m
cos-s3-csi-controller-0   2/2     Running   0          11m
cos-s3-csi-driver-bcl6m   2/2     Running   0          11m
cos-s3-csi-driver-rdqqr   2/2     Running   0          11m
cos-s3-csi-driver-wxldt   2/2     Running   0          5m11s
➜  csi-object oc delete pods cos-csi-app
pod "cos-csi-app" deleted
➜  csi-object oc get pods               
NAME                      READY   STATUS    RESTARTS   AGE
cos-s3-csi-attacher-0     1/1     Running   0          14m
cos-s3-csi-controller-0   2/2     Running   0          14m
cos-s3-csi-driver-bcl6m   2/2     Running   0          14m
cos-s3-csi-driver-rdqqr   2/2     Running   0          14m
cos-s3-csi-driver-wxldt   2/2     Running   0          8m17s
➜  csi-object oc create -f cos-csi-app.yaml                                               
Warning: would violate PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "app-frontend" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "app-frontend" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "app-frontend" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "app-frontend" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
pod/cos-csi-app created
➜  csi-object oc get pods                   
NAME                      READY   STATUS    RESTARTS   AGE
cos-csi-app               1/1     Running   0          17s
cos-s3-csi-attacher-0     1/1     Running   0          14m
cos-s3-csi-controller-0   2/2     Running   0          14m
cos-s3-csi-driver-bcl6m   2/2     Running   0          15m
cos-s3-csi-driver-rdqqr   2/2     Running   0          15m
cos-s3-csi-driver-wxldt   2/2     Running   0          8m48s
➜  csi-object oc exec -it cos-csi-app /bin/bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
root@cos-csi-app:/# ls /data
new.txt
root@cos-csi-app:/# exit
exit
➜  csi-object oc logs cos-s3-csi-driver-wxldt -c cos-s3-csi-driver > cos-s3-csi-driver.log
➜  csi-object cat cos-s3-csi-driver.log | grep "System has not been"
➜  csi-object