|
|
@@ -187,7 +187,29 @@ and
|
|
|
|
|
|
kubectl create -f local-path-storage.yaml
|
|
|
|
|
|
-This will create the provisioner as well as a default storage class named ```local-path```
|
|
|
+This will create the provisioner as well as a storage class named ```local-path```
|
|
|
+
|
|
|
+## Set default storage class
|
|
|
+
|
|
|
+ kubectl get sc
|
|
|
+
|
|
|
+ NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
|
|
|
+ hostpath (default) docker.io/hostpath Delete Immediate false 76m
|
|
|
+ local-path rancher.io/local-path Delete WaitForFirstConsumer false 2m10s
|
|
|
+
|
|
|
+ kubectl patch storageclass hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
|
|
|
+
|
|
|
+ storageclass.storage.k8s.io/hostpath patched
|
|
|
+
|
|
|
+ kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
|
|
|
+
|
|
|
+ storageclass.storage.k8s.io/local-path patched
|
|
|
+
|
|
|
+ kubectl get sc
|
|
|
+
|
|
|
+ NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
|
|
|
+ hostpath docker.io/hostpath Delete Immediate false 76m
|
|
|
+ local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 2m50s
|
|
|
|
|
|
Your PVCs either specify to use this storage class or don't specify anything and the default will be used.
|
|
|
|