add "--show-all" to kubectl get pods
add "--show-all" to "kubectl get pods --selector=job-name=pi --output=jsonpath={.items..metadata.name}" ,because the pod was ended
This commit is contained in:
@@ -66,7 +66,7 @@ To view completed pods of a job, use `kubectl get pods --show-all`. The `--show
|
|||||||
To list all the pods that belong to a job in a machine readable form, you can use a command like this:
|
To list all the pods that belong to a job in a machine readable form, you can use a command like this:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ pods=$(kubectl get pods --selector=job-name=pi --output=jsonpath={.items..metadata.name})
|
$ pods=$(kubectl get pods --show-all --selector=job-name=pi --output=jsonpath={.items..metadata.name})
|
||||||
echo $pods
|
echo $pods
|
||||||
pi-aiw0a
|
pi-aiw0a
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user