kubectl get pods not returning succeeded jobs

4 views
Skip to first unread message

Ming Fang

unread,
Nov 11, 2015, 12:28:45 AM11/11/15
to Containers at Google
I was able to successfully run the Pi Job example here https://github.com/kubernetes/kubernetes/blob/da46dab0806075b3ae593b94a1e1b8c79a47d9f1/docs/user-guide/jobs.md
After the job runs, I can no longer see the pod when I run kubectl get pods.  However the pod still shows up using the REST api curl http://<master>:8080/api/v1/pods.
I would expect the two methods of listing pods to return the same results.
Also does this mean that we have to manually delete completed jobs?

Eric Tune

unread,
Nov 11, 2015, 2:54:48 PM11/11/15
to Containers at Google
Yes you need to manually delete completed jobs. 
Having the pods show up via REST but not kubectl is definitely unexpected.  Are you sure you were listing pods in the right namespace?
With kubectl, it filters pods not in the current namespace.  Try adding the --all-namespaces option when listing with kubectl.

Daniel Smith

unread,
Nov 11, 2015, 3:02:44 PM11/11/15
to Containers at Google
Kubectl now hides failed pods by default, and probably all terminated pods. There's a flag you can pass to include these hidden pods, IIRC it's -a or --all or some such.

--
You received this message because you are subscribed to the Google Groups "Containers at Google" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-contain...@googlegroups.com.
To post to this group, send email to google-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-containers.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages