取消默认存储
kubectl patch storageclass csi-nas -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
设置默认存储
kubectl patch storageclass csi-nas -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
[root@UR-20210425NAMA ~]# kubectl get storageclasses
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
local-path rancher.io/local-path Delete WaitForFirstConsumer false 42d
[root@UR-20210425NAMA ~]# kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
storageclass.storage.k8s.io/local-path patched
[root@UR-20210425NAMA ~]# kubectl get storageclasses
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 42d
[root@UR-20210425NAMA ~]#