juju destroy-model of the k8s model hangs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Juju 2.8-rc1, snap 2.8.1+2.8-8e75b38
tl;dr: Juju cannot clean up a created k8s resources if something goes wrong during the pod deployment process.
So, I did a "juju add-k8s o7k-k8s" before, then:
ubuntu@
Added 'k8s3' model on o7k-k8s/default with credential 'o7k-k8s' for user 'admin'
ubuntu@
Deploying charm "local:
# ok so far
ubuntu@
Model Controller Cloud/Region Version SLA Timestamp
k8s3 foundations-maas o7k-k8s/default 2.8-rc1 unsupported 19:16:31Z
App Version Status Scale Charm Store Rev OS Address Notes
prometheus allocating 0/1 prometheus local 0 kubernetes Successfully assigned k8s3/prometheus
Unit Workload Agent Address Ports Message
prometheus/0 waiting allocating agent initializing
# but after some time unit is failing:
ubuntu@
Model Controller Cloud/Region Version SLA Timestamp
k8s3 foundations-maas o7k-k8s/default 2.8-rc1 unsupported 19:36:04Z
App Version Status Scale Charm Store Rev OS Address Notes
prometheus allocating 0/1 prometheus local 0 kubernetes Error: ImagePullBackOff
Unit Workload Agent Address Ports Message
prometheus/0 waiting allocating agent initializing
# so I'm trying to remove the model...
ubuntu@
WARNING! This command will destroy the "test-k8s-workload" model.
This includes all containers, applications, data and other resources.
Continue [y/N]? y
Destroying model
Waiting for model to be removed, 1 application(s), 1 volume(s), 1 filesystems(s)....
Waiting for model to be removed, 1 application(
.......
.......
.......
.......
.......
.......
.......
.......
.......
.......
.......
# and k8s resources were not cleaned up...
ubuntu@
NAME READY STATUS RESTARTS AGE
prometheus-
# even from the previous deployment
ubuntu@
NAME READY STATUS RESTARTS AGE
prometheus-
description: | updated |
When something goes wrong and agents aren't running to destroy things cleanly, the --force option is the option to use.
juju destroy-model --destroy-storage --force
Can you please try and and re-open if it doesn't work. it may take at least a minute for it to allow things to try and complete normally before it forces the removal.