فهرست منبع

Instrucciones para default storage class

Celestino Rey 4 ماه پیش
والد
کامیت
ffe5b8ae65
1فایلهای تغییر یافته به همراه23 افزوده شده و 1 حذف شده
  1. 23 1
      RANCHER_DESKTOP.md

+ 23 - 1
RANCHER_DESKTOP.md

@@ -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.