{"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

Describe pv and patch it <\/h3>\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\n

Replace it with storage class id<\/h3>\n\n\n\n
microk8s.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\n

Check again the patch is succeed<\/h3>\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   25Gi       RWX            Delete           Bound    container-registry\/registry-claim   microk8s-hostpath   <unset>                          48m<\/code><\/pre>\n\n\n\n
\"\"<\/a><\/figure>\n\n\n\n

Reference<\/p>\n\n\n\n

    \n
  1. https:\/\/articles.maximemoreillon.com\/articles\/567<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"

    By default microk8s will create 20GiB disk space, If you need to expand it, you will have to Describe pv…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,32],"tags":[],"class_list":["post-4850","post","type-post","status-publish","format-standard","hentry","category-linux","category-technology"],"_links":{"self":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/comments?post=4850"}],"version-history":[{"count":1,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4850\/revisions"}],"predecessor-version":[{"id":4852,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4850\/revisions\/4852"}],"wp:attachment":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/media?parent=4850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/categories?post=4850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/tags?post=4850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}