Kubernetes: [Question] How do you find out what a pod belongs to (Rep. Controller, Deployment, Replica Set, etc.?

Created on 5 Sep 2016  路  3Comments  路  Source: kubernetes/kubernetes

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): It's a bit tough to search for this since this includes a lot of keywords.


Is this a BUG REPORT or FEATURE REQUEST? (choose one): Question

Pretty much what the title says. I'm asking because sometimes I want to kill a pod for good but I don't remember what I used to create it.

arekubectl

Most helpful comment

@AdoHe But that's assuming it was set in the first place which I didn't do. However, your suggestion lead to the following.

With the describe call, you can just grep for Controllers.

kubectl describe pods dd-agent-4qwo1 | grep Controllers
# Controllers:      DaemonSet/dd-agent

In the case of a lone pod running, Controllers will be empty.

kubectl describe pods apache | grep Controllers
# Controllers:      <none>

Thanks!

All 3 comments

@jason-riddle I think you could check the created-by annotation of pod.

@AdoHe But that's assuming it was set in the first place which I didn't do. However, your suggestion lead to the following.

With the describe call, you can just grep for Controllers.

kubectl describe pods dd-agent-4qwo1 | grep Controllers
# Controllers:      DaemonSet/dd-agent

In the case of a lone pod running, Controllers will be empty.

kubectl describe pods apache | grep Controllers
# Controllers:      <none>

Thanks!

Worked for me:

kubectldescribepod <Podname> -n <namespace> | grep "Controlled By"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sjenning picture sjenning  路  3Comments

pwittrock picture pwittrock  路  3Comments

chowyu08 picture chowyu08  路  3Comments

arun-gupta picture arun-gupta  路  3Comments

sanjana-bhat picture sanjana-bhat  路  3Comments