Can not delete deployment on kubernetes

8/23/2018

I installed Kubernetes version 10

 kubectl version
 Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead",GitTreeState:"archive", BuildDate:"2018-03-29T08:38:42Z",GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
 Server Version: version.Info{Major:"1", Minor:"10",  GitVersion:"v1.10.0",  GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"archive", BuildDate:"2018-03-29T08:38:42Z", 
 GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}

When i execute :

kubectl delete deployment example
Error: unknown command "verion" for "kubectl"

it is not useful here to put --force Or --cascade=false ==> I tried all this put there is no change

When I execute :

 kubectl get nodes ==> Master return Nodes , it is Okay 

Any help ?

-- Net Sim
kubernetes

3 Answers

8/24/2018

I solved it By putting the Right ca.crt and server.key in the Controller-manager :

/etc/kubernetes/controller-manager

KUBE_CONTROLLER_MANAGER_ARGS="--root-ca-file=/srv/kubernetes/ca.crt --service-account-private-key-file=/srv/kubernetes/server.key"
-- Net Sim
Source: StackOverflow

11/5/2019

Use

kubectl get all

This lists all the pods, service, deployment, replicaset, job and cronjobs. from this you can know the name of deployment you want to delete.

kubectl delete <name of deployment as displayed from get all command>
-- Muthukumaran
Source: StackOverflow

3/16/2019

I had a similar issue where I could not delete a deployment with Kubernetes installed in Docker Desktop. The solution has been going to Docker Desktop > Preferences > Reset Kubernetes cluster.

-- Jiayi Hu
Source: StackOverflow