2020-05-11 19:40:48 |
Vladimir Grevtsev |
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@OrangeBox84:~/charm-k8s-prometheus$ juju add-model k8s3 o7k-k8s
Added 'k8s3' model on o7k-k8s/default with credential 'o7k-k8s' for user 'admin'
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ juju deploy . --resource prometheus-image=prom/prometheus:latest
Deploying charm "local:kubernetes/prometheus-0".
# ok so far
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ j status
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-operator-0 to juju-6d7577-k8s-9
Unit Workload Agent Address Ports Message
prometheus/0 waiting allocating agent initializing
# but after some time unit is failing:
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ j status
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@OrangeBox84:~/charm-k8s-prometheus$ j destroy-model test-k8s-workload --destroy-storage
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(s)...............................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
...............................................................ERROR timeout after 30m0s timeout
# and k8s resources were not cleaned up...
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ kubectl get pods -n test-k8s-workload
NAME READY STATUS RESTARTS AGE
prometheus-operator-0 0/1 ImagePullBackOff 0 131m |
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@OrangeBox84:~/charm-k8s-prometheus$ juju add-model k8s3 o7k-k8s
Added 'k8s3' model on o7k-k8s/default with credential 'o7k-k8s' for user 'admin'
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ juju deploy . --resource prometheus-image=prom/prometheus:latest
Deploying charm "local:kubernetes/prometheus-0".
# ok so far
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ j status
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-operator-0 to juju-6d7577-k8s-9
Unit Workload Agent Address Ports Message
prometheus/0 waiting allocating agent initializing
# but after some time unit is failing:
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ j status
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@OrangeBox84:~/charm-k8s-prometheus$ j destroy-model test-k8s-workload --destroy-storage
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(s)...............................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
...............................................................ERROR timeout after 30m0s timeout
# and k8s resources were not cleaned up...
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ kubectl get pods -n k8s3
NAME READY STATUS RESTARTS AGE
prometheus-operator-0 0/1 ImagePullBackOff 0 23m
# even from the previous deployment
ubuntu@OrangeBox84:~/charm-k8s-prometheus$ kubectl get pods -n test-k8s-workload
NAME READY STATUS RESTARTS AGE
prometheus-operator-0 0/1 ImagePullBackOff 0 131m |
|