Closed ljtbbt closed 3 years ago
Yes, this issue has been encountered once in a Kubernetes clusters, but what is the specific version of CSI? In the next version, the mount point check will be added.
Do not know, but I suspect after certain kubernetes version, kube cease to create mountpoint.
kubernetes v1.20. In this version, the mount point is not exist, there is a need for CSI to create the mount point.
rancher01:~/yamls # kubectl get node NAME STATUS ROLES AGE VERSION rancher01 Ready controlplane,etcd,worker 8d v1.20.6 rancher02 Ready worker 8d v1.20.6 rancher03 Ready worker 7d23h v1.20.6
Also, you can feedback your cluster version.
func (d Driver) NodePublishVolume(ctx context.Context, req csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
//add the following code to it output, err1 := utils.ExecShellCmd("mkdir -p %s", targetPath) if err1 != nil { msg := fmt.Sprintf("failed to mkdir targetPath %s error: %s", targetPath, output) log.Errorln(msg) return nil, status.Error(codes.Internal, msg) }