unsupport for `kubectl delete <pod ip>` in kubernetes UX

11/19/2015

It would be great if we have

kubectl delete pod/<pod-ip>

Is there any particular reason to avoid this UX?

-- Emma He
kubernetes

1 Answer

1/21/2016

The best way to manage deletions is by label, you can always do kubectl label pod foo ip=1.2.3.4 and then kubectl delete pod -l ip=1.2.3.4 if you really want to target the ip.

Some context: Addressing a pod by ip supported out of the box because it would encourage higher level control systems (either automated or cluster admins) that hinge on IP, and IPs of containers are supposed to be ephemeral. One might draw an analogy to a stack frame in C, an un-initialized variable might have the same value on second entry into a function, but that doesn't mean one should count on that value to always be the same.

-- Prashanth B
Source: StackOverflow