Erro mount SMB shared with customized kubelet path
gustavocearasc opened this issue · comments
Hello,
I have a enviroment with k8s 1.23 and I need to access a shared in windows server.
I have installed csi-driver-smb in my cluster, but when I try to mount it on pod , i have an error.
Log events:
Warning FailedMount pod/nginx MountVolume.MountDevice failed for volume "pv-smb" : rpc error: code = Internal desc = MkdirAll /mnt/paas/kubernetes/kubelet/plugins/kubernetes.io/csi/pv/pv-smb/globalmount failed with error: mkdir /mnt/paas: read-only file system
PV:
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-smb
spec:
capacity:
storage: 10Gi # PV-Size
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
storageClassName: smb
mountOptions:
- dir_mode=0777
- file_mode=0777
csi:
driver: smb.csi.k8s.io
readOnly: false
volumeHandle: VOLUME_ID # Must be unique in the EKS Cluster, eg: PV-1
volumeAttributes:
source: "//10.150.6.67/shared"
nodeStageSecretRef:
name: smbcreds
namespace: teste
PVC:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-smb
namespace: teste
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi # Size of the PVC, must be lower then the PV-Size.
volumeName: pv-smb
storageClassName: smb
POD:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
namespace: teste
spec:
volumes:
- name: smb
persistentVolumeClaim:
claimName: pvc-smb
containers:
- image: ubuntu
name: nginx
command: ['sleep','5000']
volumeMounts:- name: smb
mountPath: "/pv/pv-smb"
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
- name: smb
Any ideia about it?
@gustavocearasc have you set --set linux.kubelet=
parameter in helm chart install, here is the guide: https://github.com/kubernetes-csi/csi-driver-smb/tree/master/charts#tips
what is your kubelet path? is it /mnt/paas/kubernetes/kubelet
?
have you set mount --make-shared /mnt/paas/kubernetes/kubelet
?
Sorrey, I didn't understand your question.
But this cluster is SAAS in huawei cloud, this mount is default of the cluster.
Same as #639
if your kubelet path is /var/paas/kubernetes/kubelet
Try to add --set linux.kubelet="/var/paas/kubernetes/kubelet"
in helm install
command
Ref:
https://github.com/kubernetes-csi/csi-driver-smb/tree/master/charts#latest-chart-configuration
Parameter | Description |
---|---|
linux.kubelet | configure kubelet directory path on Linux agent node node |
Hello,
Thank you guys.
It is works now.
To install it in Huawei CCE this command works:
helm install csi-driver-smb csi-driver-smb/csi-driver-smb --namespace kube-system --version v1.13.0 --set linux.kubelet="/mnt/paas/kubernetes/kubelet"
v1.14 chart config would be fixed by #741