How to delete a daemonset and service in Kubernates

12/5/2018

I am new to Kubernetes so pardon me if you find my question noob.

I have created a Daemonset called testDaemon.yml which is having a service in it called testService. Both were created but now I have made some minor changes and I need to re-create it.

I tried deleting the services and daemonset:

kubectl delete ds testDaemon
kubectl delete svc testService 

but both of them is getting recreated everytime I delete them and I am getting an error that services "testService" already existswhen I run kubectl create -f testDaemon.yml again.

What should I do to remove the DaemonSet completely or update the same with the new template?

-- Vikas Rathore
kubernetes

1 Answer

12/5/2018

You can delete it using kubectl delete -f testDaemon.yml

It will delete the statefulset and service both.

-- Prafull Ladha
Source: StackOverflow