charmed-kubernetes / kubernetes-docs

This repository contains the development version of docs for Charmed Kubernetes
8 stars 54 forks source link

Issue with Juju Destroy-Model Command on Kubernetes Model #820

Closed hazem-soussi closed 11 months ago

hazem-soussi commented 1 year ago

Overview Encountered an issue while using the Juju destroy-model command to remove a Kubernetes model (k8s-model). The process seems to be stuck at the "Waiting for model to be removed" stage. Steps to Reproduce

  1. Run the following command to destroy the model: `juju destroy-model k8s-model --force --destroy-storage --debug ` Observed Behavior The destroy-model command is initiated successfully, but it gets stuck at the "Waiting for model to be removed, 3 volume(s)..." stage. The command does not complete, and the model removal process seems to be taking longer than expected.

Additional Information Environment Juju Version: 3.2.4 Kubernetes Cluster Status: [destroyed] Operating System: Ubuntu 22.04.3 LTS

> 20:42:52 INFO  juju.cmd supercommand.go:56 running juju [3.2.4 3052b293cbab49b1a2f994724d2c90e80954cfe3 gc go1.20.11]
> 20:42:52 DEBUG juju.cmd supercommand.go:57   args: []string{"/snap/juju/25443/bin/juju", "destroy-model", "k8s-model", "--force", "--destroy-storage", "--debug"}
> 20:42:52 INFO  juju.juju api.go:86 connecting to API addresses: [10.217.74.97:17070]
> 20:42:52 DEBUG juju.api apiclient.go:1171 successfully dialed "wss://10.217.74.97:17070/api"
> 20:42:52 INFO  juju.api apiclient.go:706 connection established to "wss://10.217.74.97:17070/api"
> 20:42:52 WARN  cmd destroy.go:266 This command will destroy the "k8s-model" model and all its resources. It cannot be stopped.
> 
> To continue, enter the name of the model to be destroyed: k8s-model
> Destroying model
> Waiting for model to be removed, 3 volume(s)......
> 

### Expected Behavior The destroy-model command should successfully remove the specified Kubernetes model and its associated resources without getting stuck at the "Waiting for model to be removed" stage.

Note

This issue is being documented for further investigation and potential resolution. Any assistance or guidance from the community is highly appreciated.

hazem-soussi commented 1 year ago

Logs :

> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:54 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:55 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
> machine-0: 20:40:55 WARNING juju.state cleanup failed in model b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb for forceStorage("b2545c6d-5f0d-4ee8-88c5-8e5f2e3db4eb"): removing volume 0: volume is not dead
evilnick commented 11 months ago

Hi. Sorry for the delay.

I can confirm that is the correct command, and the issue seems to be with Juju and/or the cluster rather than with the documentation. Obviously from the logs it looks like the storage is the issue - may be helpful to include what type of storage was set up for the cluster. Juju bugs are tracked in launchpad - sorry I can't just move this issue here. If it is still a problem you can file a bug on launchpad

hazem-soussi commented 11 months ago

@evilnick That was fixed by investigating the attached volumes to the model Thanks for contributing