add new examples for fieldSelector when using kubectl get (#6312)
This commit is contained in:
@@ -119,6 +119,9 @@ $ kubectl get pods --sort-by='.status.containerStatuses[0].restartCount'
|
|||||||
$ kubectl get pods --selector=app=cassandra rc -o \
|
$ kubectl get pods --selector=app=cassandra rc -o \
|
||||||
jsonpath='{.items[*].metadata.labels.version}'
|
jsonpath='{.items[*].metadata.labels.version}'
|
||||||
|
|
||||||
|
# Get all running pods in the namespace
|
||||||
|
$ kubectl get pods --field-selector=status.phase=Running
|
||||||
|
|
||||||
# Get ExternalIPs of all nodes
|
# Get ExternalIPs of all nodes
|
||||||
$ kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP")].address}'
|
$ kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP")].address}'
|
||||||
|
|
||||||
|
|||||||
@@ -242,6 +242,9 @@ $ kubectl get rc,services
|
|||||||
|
|
||||||
// List all daemon sets, including uninitialized ones, in plain-text output format.
|
// List all daemon sets, including uninitialized ones, in plain-text output format.
|
||||||
$ kubectl get ds --include-uninitialized
|
$ kubectl get ds --include-uninitialized
|
||||||
|
|
||||||
|
// List all pods running on node server01
|
||||||
|
$ kubectl get pods --field-selector=spec.nodeName=server01
|
||||||
```
|
```
|
||||||
|
|
||||||
`kubectl describe` - Display detailed state of one or more resources, including the uninitialized ones by default.
|
`kubectl describe` - Display detailed state of one or more resources, including the uninitialized ones by default.
|
||||||
|
|||||||
Reference in New Issue
Block a user