Delete pods after running

1 view
Skip to first unread message

Yang Wu

unread,
Jan 18, 2016, 8:44:54 PM1/18/16
to Containers at Google
Hi all,

Is there a way to delete pods after running, like the '--rm' arguent in docker?

If start a pod by `kubectl create -f`, I can get the result and the pod and rc is deleted automatically. When use API or `kubectl run`, the pod generates results too, but the pod is not deleted and `kubectl get pods -a` shows that the status is "Error".

Yang Wu

unread,
Jan 18, 2016, 9:01:06 PM1/18/16
to Containers at Google
The output of `kubectl get pods -a`
kubectl get pods -a
NAME READY STATUS RESTARTS AGE
testpod 0/1 Error 0 24s

The output of `kubectl describe pod testpod`:
Name:  testpod
Namespace: default
...
Status: Succeeded

Reply all
Reply to author
Forward
0 new messages