This driver could not only mount Azure File share, it also supports mount on-premise SMB server as long as agent node could access the target SMB server.
- Create a Kubernetes secret to store on-premise SMB server username and password
kubectl create secret -ns teste generic smbcreds --from-literal azurestorageaccountname=USERNAME --from-literal azurestorageaccountkey="PASSWORD"
- Create an inline volume pod with on-premise SMB server mount
download
nginx-on-prem-volume.yaml
, editserver
,shareName
,secretName
wget https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/smb-provisioner/nginx-on-prem-volume.yaml
# edit nginx-on-prem-volume.yaml
kubectl apply -f nginx-on-prem-volume.yaml
- Check on-prem smb mount
kubectl exec -it nginx-on-prem-volume -- df -h
Filesystem Size Used Avail Use% Mounted on ... //smb-server.default.svc.cluster.local/share 124G 45G 80G 37% /mnt/smb