Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

microk8s.reset doesn't clean up volumes #488

Closed
knkski opened this issue May 28, 2019 · 9 comments
Closed

microk8s.reset doesn't clean up volumes #488

knkski opened this issue May 28, 2019 · 9 comments

Comments

@knkski
Copy link
Collaborator

@knkski knkski commented May 28, 2019

I attempted to remove the microk8s snap, and it hung on Save data of snap "microk8s" in automatic snapshot set. After investigating a bit, it looks like microk8s.reset doesn't clean up volumes, and I had many of them left over:

$ sudo du -sh /var/snap/microk8s/common/
37G	/var/snap/microk8s/common/

With paths like this: /var/snap/microk8s/common/default-storage/kubeflow-database-a6dbbcb2-mariadb-0-pvc-a75a4c3b-6b61-11e9-bf3c-e86a6466b483/

After running sudo rm -rf /var/snap/microk8s/common/*, removing the microk8s snap worked great.

@ktsakalozos

This comment has been minimized.

Copy link
Member

@ktsakalozos ktsakalozos commented May 29, 2019

@knkski this is somewhat expected. We are not removing persistent volumes unless you do a microk8s.disable storage and answer "Yes" to the respective question. The reasn for not cleaning up persistent volumes without confirmation is that you may have some data you may want to keep. Having said that, we may want to have a flag on the microk8s.reset to clean persistent volumes as well. What do you think?

@knkski

This comment has been minimized.

Copy link
Collaborator Author

@knkski knkski commented May 29, 2019

@ktsakalozos: A flag on microk8s.reset sounds perfect. For comparison, juju has a --destroy-storage on kill-controller that does the same thing

@TomHellier

This comment has been minimized.

Copy link

@TomHellier TomHellier commented Jun 3, 2019

I am facing this issue as well, I think it would be nice for a warning to show up here .e.g.

Save data of snap "microk8s" in automatic snapshot set #2
WARN: persistent data exists in /var/snap/microk8s/common/, run microk8s.disable storage to remove
@knkski

This comment has been minimized.

Copy link
Collaborator Author

@knkski knkski commented Jun 5, 2019

@ktsakalozos: I tried disabling storage (after having just done a microk8s.reset), and got this:

$ microk8s.disable storage
Disabling default storage
storageclass.storage.k8s.io "microk8s-hostpath" deleted
Error from server (NotFound): error when deleting "/home/knkski/snap/microk8s/522/tmp/temp.storage.yaml": deployments.extensions "hostpath-provisioner" not found
Failed to disable storage
@ktsakalozos

This comment has been minimized.

Copy link
Member

@ktsakalozos ktsakalozos commented Jun 5, 2019

Did you microk8s.disable storage after a microk8s.reset?

Could you do a microk8s.enable storage and then a microk8s.disable storage? I suspect the microk8s.reset removed the storage daemon resulting in the error you got.

@knkski

This comment has been minimized.

Copy link
Collaborator Author

@knkski knkski commented Jun 5, 2019

@ktsakalozos: Looks like microk8s.enable storage, then microk8s.disable storage worked, thanks! Do you think it would make sense to open a new bug for adding in some output like this?

Failed to disable storage, is the storage daemon running? You may need to run `microk8s.enable storage` first.
@ktsakalozos

This comment has been minimized.

Copy link
Member

@ktsakalozos ktsakalozos commented Jun 5, 2019

open a new bug for adding in some output

Yes, that would be a great entry level patch! Go ahead with creating an issue with the suggested improvement.

rzr added a commit to TizenTeam/microk8s that referenced this issue Aug 27, 2019
This will help for cleaning  volume

- Reintroduce cluster_clean removed by @ktsakalozos (8173dce)

Relate-to: ubuntu#488
Change-Id: I04a13f060b1c4beda9dd5006c435e5b2be12c385
Signed-off-by: Philippe Coval <p.coval@samsung.com>
rzr added a commit to TizenTeam/microk8s that referenced this issue Aug 27, 2019
This will help for cleaning  volume

- Reintroduce cluster_clean removed by @ktsakalozos (8173dce)

Relate-to: ubuntu#488
Change-Id: I04a13f060b1c4beda9dd5006c435e5b2be12c385
Signed-off-by: Philippe Coval <p.coval@samsung.com>
rzr added a commit to TizenTeam/microk8s that referenced this issue Sep 3, 2019
This will help for cleaning volumes

Relate-to: ubuntu#488
Change-Id: I04a13f060b1c4beda9dd5006c435e5b2be12c385
Signed-off-by: Philippe Coval <p.coval@samsung.com>
ktsakalozos added a commit that referenced this issue Sep 12, 2019
This will help for cleaning volumes

Relate-to: #488
Change-Id: I04a13f060b1c4beda9dd5006c435e5b2be12c385
Signed-off-by: Philippe Coval <p.coval@samsung.com>
@rzr

This comment has been minimized.

Copy link
Contributor

@rzr rzr commented Oct 1, 2019

I guess this issue can be closed since release of v1.16.0 (920) ?

microk8s.reset --destroy-storage
du -csh /var/snap/microk8s/common/*
40K     /var/snap/microk8s/common/run
176M    /var/snap/microk8s/common/var
176M    total

Relate-to: #616

@ktsakalozos

This comment has been minimized.

Copy link
Member

@ktsakalozos ktsakalozos commented Oct 1, 2019

Yes, thank you @rzr

@ktsakalozos ktsakalozos closed this Oct 1, 2019
ianbibby added a commit to ianbibby/microk8s that referenced this issue Jan 10, 2020
This will help for cleaning volumes

Relate-to: ubuntu#488
Change-Id: I04a13f060b1c4beda9dd5006c435e5b2be12c385
Signed-off-by: Philippe Coval <p.coval@samsung.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.