0

I wonder why helm uninstall does not remove my pods.

Example and minimum viable code, as in https://helm.sh/docs/intro/using_helm/ :

$ kubectl create namespace mydemo
namespace/mydemo created

$ helm install happy-panda bitnami/wordpress -n mydemo
NAME: happy-panda
LAST DEPLOYED: Fri Jan 13 08:50:58 2023
NAMESPACE: mydemo
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: wordpress
CHART VERSION: 15.2.22
APP VERSION: 6.1.1

** Please be patient while the chart is being deployed **

Your WordPress site can be accessed through the following DNS name from within your cluster:

    happy-panda-wordpress.mydemo.svc.cluster.local (port 80)

To access your WordPress site from outside the cluster follow the steps below:

1. Get the WordPress URL by running these commands:

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace mydemo -w happy-panda-wordpress'

   export SERVICE_IP=$(kubectl get svc --namespace mydemo happy-panda-wordpress --include "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
   echo "WordPress URL: http://$SERVICE_IP/"
   echo "WordPress Admin URL: http://$SERVICE_IP/admin"

2. Open a browser and access WordPress using the obtained URL.

3. Login with the following credentials below to see your blog:

  echo Username: user
  echo Password: $(kubectl get secret --namespace mydemo happy-panda-wordpress -o jsonpath="{.data.wordpress-password}" | base64 -d)

Installation goes well; the helm release shows up and resources are available (get ready soon afterwards):

$ kubectl get all -n mydemo
NAME                                         READY   STATUS    RESTARTS   AGE
pod/happy-panda-wordpress-6756b48578-xqzwr   0/1     Running   0          23s
pod/happy-panda-mariadb-0                    0/1     Running   0          23s

NAME                            TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
service/happy-panda-mariadb     ClusterIP      10.152.183.104   <none>        3306/TCP                     23s
service/happy-panda-wordpress   LoadBalancer   10.152.183.221   <pending>     80:31402/TCP,443:32116/TCP   23s

NAME                                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/happy-panda-wordpress   0/1     1            0           23s

NAME                                               DESIRED   CURRENT   READY   AGE
replicaset.apps/happy-panda-wordpress-6756b48578   1         1         0       23s

NAME                                   READY   AGE
statefulset.apps/happy-panda-mariadb   0/1     23s

$ helm list -n mydemo
NAME        NAMESPACE   REVISION    UPDATED                                     STATUS      CHART               APP VERSION
happy-panda mydemo      1           2023-01-13 08:50:58.636327755 +1300 NZDT    deployed    wordpress-15.2.22   6.1.1      

Now, we try to uninstall the helm release:


$ helm uninstall happy-panda -n mydemo
release "happy-panda" uninstalled

The helm release is gone as expected:

$ helm list -n mydemo
NAME    NAMESPACE   REVISION    UPDATED STATUS  CHART   APP VERSION

... unfortunately, some resources are still there:

$ kubectl get all -n mydemo
NAME                                         READY   STATUS    RESTARTS   AGE
pod/happy-panda-mariadb-0                    1/1     Running   0          2m17s
pod/happy-panda-wordpress-6756b48578-xqzwr   0/1     Running   0          2m17s

NAME                                               DESIRED   CURRENT   READY   AGE
replicaset.apps/happy-panda-wordpress-6756b48578   1         1         0       2m17s

I was on microk8s version 1.25 previously, but have upgraded to 1.26 already.

$ microk8s version
MicroK8s v1.26.0 revision 4390

$ helm version
version.BuildInfo{Version:"v3.10.3", GitCommit:"835b7334cfe2e5e27870ab3ed4135f136eecc704", GitTreeState:"clean", GoVersion:"go1.18.9"}

Now, I can obviously force-delete the namespace, but it would be so much nicer to use the helm uninstall functionality as intended. - This is on a local dev machine, running on Ubuntu 22.04.

Any ideas?

hey
  • 2,643
  • 7
  • 29
  • 50
  • 1
    Might be worth trying on an alternative local k8s distribution like kind or minikube and see if the same thing occurs. If not (i.e it deletes cleanly under kind/minikube), then maybe you've hit a bug with Microk8s or how is has been configure. Also, I assume you're using binami's Wordpress chart (https://artifacthub.io/packages/helm/bitnami/wordpress) -- if so, they have a later version (15.2.26) -- try that version and see if anything is different. If 15.2.26 works but 15.2.22 doesn't, then there's a bug in 15.2.22 that they fixed. – Blender Fox Jan 12 '23 at 21:40
  • Thanks; I'll try alternative local distributions and get back. I don't think it's the helm chart version, as the same happens to any helm chart I have tried. – hey Jan 12 '23 at 23:45
  • I've tried another local k8s distribution as suggested: with `minikube`, I cannot reproduce the issue. All resources are removed with `helm uninstall [...]`, as expected. It might be a microk8s issue. Interesting... – hey Jan 13 '23 at 08:23

0 Answers0