0

I have installed RKE2 cluster with following command:

sudo curl -sfL https://get.rke2.io | sudo INSTALL_RKE2_TYPE=server INSTALL_RKE2_CHANNEL=v1.23.16+rke2r1 sh - 

Then I've deployed a few applications. Then I've decided to reinstall RKE2 with different version. I've used following command to uninstall current cluster:

/usr/local/bin/rke2-uninstall.sh

After then I've used that command to install RKE2 with different version:

sudo curl -sfL https://get.rke2.io | sudo INSTALL_RKE2_TYPE=server INSTALL_RKE2_CHANNEL=v1.25.9+rke2r1 sh - 

Everything was okay, but I've noticed that when I've run "kubectl get pods -A" there were remaining pods from previous cluster. However I've removed cluster. How Can I be sure about everything will be gone when I uninstalled the cluster?

oakkose
  • 353
  • 3
  • 13
  • added my +1 vote cancel out the troll who gave it a -1 without explanation. I assume their reason was that this belong more to serverfault rather than stackoverflow. But that's just speculation. – d_inevitable Jun 21 '23 at 10:27

1 Answers1

1

You can delete all namespaces and every components (pods, deployments, services, etc.) inside every namespace before to uninstall the cluster with this command:

kubectl delete --all namespaces

Verify that every pod has been deleted with the command:

kubectl get pod --all-namespaces
Alez
  • 1,913
  • 3
  • 18
  • 22
  • Is it normal to see remaining pods when reinstalled the k8s cluster? – oakkose May 19 '23 at 12:30
  • From the documentation of RKE2 seems not normal because they report "Uninstalling RKE2 deletes the cluster data and all of the scripts.". Different thing would be if you upgrade it (without uninstall) because in this case the application should continue to work. My guess is when you install back RKE it finds the etcd database in the installation folder with the information about your previous applications. – Alez May 19 '23 at 13:10
  • @oakkose did my answer solve your doubts? – Alez May 22 '23 at 06:39