7
votes

I'm running Kubernetes via Docker. Following the tutorial I launched an Nginx POD using kubectl run nginx --image=nginx --port=80. However this seems to create orphaned PODs (without a replication controller). kubectl get rc doesn't return anything and kubectl describe pod nginx-198147104-kqudh shows Replication Controllers: none (kubectl version "v1.2.0+5cb86ee" shows Controllers: ReplicaSet/nginx-198147104 but scaling it to 0 just causes a new Nginx pod to be created, and it can't be deleted).

I would like to be able to delete the Kubernetes managed Nginx container from Docker. I haven't had much luck find out how to delete an orphan pod (without it being recreated...).

Client Version: version.Info{Major:"1", Minor:"0", GitVersion:"v1.0.4", GitCommit:"65d28d5fd12345592405714c81cd03b9c41d41d9", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"5cb86ee022267586db386f62781338b0483733b3", GitTreeState:"clean"}

1

1 Answers

8
votes

With v1.2 Kubernetes we use ReplicaSet (a newer form of ReplicationController). Given that you have a ReplicaSet, you must have used a v1.2 client to create it. But it doesn't stop there. What 1.2 actually creates for you is a Deployment which itself manages ReplicaSets.

So what you need to know is kubectl scale deployment or kubectl delete deployment.

Which tutorial are you following?