You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/reference/kubectl/cheatsheet.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -351,6 +351,21 @@ Output format | Description
351
351
`-o=wide` | Output in the plain-text format with any additional information, and for pods, the node name is included
352
352
`-o=yaml` | Output a YAML formatted API object
353
353
354
+
Examples using `-o=custom-columns`:
355
+
356
+
```bash
357
+
# All images running in a cluster
358
+
kubectl get pods -A -o=custom-columns='DATA:spec.containers[*].image'
359
+
360
+
# All images excluding "k8s.gcr.io/coredns:1.6.2"
361
+
kubectl get pods -A -o=custom-columns='DATA:spec.containers[?(@.image!="k8s.gcr.io/coredns:1.6.2")].image'
362
+
363
+
# All fields under metadata regardless of name
364
+
kubectl get pods -A -o=custom-columns='DATA:metadata.*'
365
+
```
366
+
367
+
More examples in the kubectl [reference documentation](/docs/reference/kubectl/overview/#custom-columns).
368
+
354
369
### Kubectl output verbosity and debugging
355
370
356
371
Kubectl verbosity is controlled with the `-v` or `--v` flags followed by an integer representing the log level. General Kubernetes logging conventions and the associated log levels are described [here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md).
0 commit comments