{"id":4850,"date":"2024-08-20T02:19:28","date_gmt":"2024-08-19T18:19:28","guid":{"rendered":"https:\/\/www.ookangzheng.com\/?p=4850"},"modified":"2024-08-20T02:19:29","modified_gmt":"2024-08-19T18:19:29","slug":"microk8s-resize-default-storage-persistent-volumes","status":"publish","type":"post","link":"https:\/\/www.ookangzheng.com\/microk8s-resize-default-storage-persistent-volumes\/","title":{"rendered":"MicroK8s resize default storage Persistent Volumes"},"content":{"rendered":"\n
By default microk8s will create 20GiB disk space, If you need to expand it, you will have to <\/p>\n\n\n\n
microk8s.kubectl get pv\n\nNAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE\npvc-ed8babeb-6292-406c-a664-289683549f1a 20Gi RWX Delete Bound container-registry\/registry-claim microk8s-hostpath <unset> 47m<\/code><\/pre>\n\n\n\nReplace it with storage class id<\/h3>\n\n\n\nmicrok8s.kubectl patch pv <YOUR STORAGE CLASS ID> -p '{\"spec\":{\"capacity\":{\"storage\":\"25Gi\"}}}'\n\npersistentvolume\/pvc-ed8babeb-6292-406c-a664-289683549f1a patched<\/code><\/pre>\n\n\n\nCheck again the patch is succeed<\/h3>\n\n\n\nmicrok8s.kubectl get pv\n\nNAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE\npvc-ed8babeb-6292-406c-a664-289683549f1a 25Gi RWX Delete Bound container-registry\/registry-claim microk8s-hostpath <unset> 48m<\/code><\/pre>\n\n\n\n