root@k8s-master-37117435-0:/azure_file# kubectl create -f /azure_file/azure-secret.yaml
secret "azure-secret01" created
root@k8s-master-37117435-0:/azure_file# kubectl get secret
NAME TYPE DATA AGE
azure-secret Opaque 2 3d
azure-secret01 Opaque 2 11s
default-token-7w4s9 kubernetes.io/service-account-token 3 4d
root@k8s-master-37117435-0:/azure_file# kubectl create -f /azure_file/azure.yaml
pod "nginx" created
root@k8s-master-37117435-0:/azure_file# kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 34s
Now, pod create is completed, we can use this script to check file,like this:
root@k8s-master-37117435-0:/azure_file# kubectl exec -it nginx bash
root@nginx:/# cd /mnt
root@nginx:/mnt# ls
azure
root@nginx:/mnt# cd azure
root@nginx:/mnt/azure# ls
2.2.jpg a
root@nginx:/mnt/azure# df -Th
Filesystem Type Size Used Avail Use% Mounted on
overlay overlay 30G 4.1G 25G 15% /
tmpfs tmpfs 966M 0 966M 0% /dev
tmpfs tmpfs 966M 0 966M 0% /sys/fs/cgroup
//imagesdisks845.file.core.chinacloudapi.cn/azurefile cifs 5.0T 128K 5.0T 1% /mnt/azure
/dev/sda1 ext4 30G 4.1G 25G 15% /etc/hosts
shm tmpfs 64M 0 64M 0% /dev/shm
tmpfs tmpfs 966M 12K 966M 1% /run/secrets/kubernetes.io/serviceaccount
tmpfs tmpfs 966M 0 966M 0% /sys/firmware
root@nginx:/mnt/azure# touch k8stest
root@nginx:/mnt/azure# ls
2.2.jpg a k8stest
root@nginx:/mnt/azure#