Home:ALL Converter>Kubernetes cluster not deleting

Kubernetes cluster not deleting

Ask Time:2019-08-27T17:25:33         Author:Mr.DevEng

Json Formatter

I am trying to delete the entire kubernetes that created for my CI/CD pipeline R&D. So for deleting the cluster and everything I run the following command,

kubectl config delete-cluster <cluster-name> 

kubectl config delete-context <Cluster-context>  

For making sure that the clustee is deleted, I build the jenkins pipeline job again. So I found that it is deploying with updated changes.

When I run the command "kubectl config view", I found the following result,

docker@mildevdcr01:~$ kubectl config view
apiVersion: v1
clusters: []
contexts: []
current-context: [email protected]
kind: Config
preferences: {}
users: []
docker@mildevdcr01:~$

Still my Spring Boot micro service is deploying in cluster with updated changes.

I created the Kubernetes cluster using kubespray tool that I got reference from Github:

https://github.com/kubernetes-incubator/kubespray.git

What do I need to do for the deletion of everything that I created for this Kubernetes cluster? I need to remove everything including master node.

Author:Mr.DevEng,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/57671556/kubernetes-cluster-not-deleting
Malgorzata :

If you setup your cluster using Kubespray, you ran whole installation using ansible, so to delete cluster you have to use it too.\n\nBut you can also reset the entire cluster for fresh installation:\n\n$ ansible-playbook -i inventory/mycluster/hosts.ini reset.yml\n\n\nRemember to keep the “hosts.ini” updated properly.\n\nYou can remove node by node from your cluster simply adding specific node do section [kube-node] in inventory/mycluster/hosts.ini file (your hosts file) and run command:\n\n $ ansible-playbook -i inventory/mycluster/hosts.ini remove-node.yml\n\n\nKubeSpray documentation: kubespray.\n\nUseful articles: kubespray-steps, kubespray-ansible.",
2019-08-28T12:05:27
yy