From 122ffec5c213c1a1f0e63ecdf6fe44d1463807e5 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Tue, 16 Jun 2020 22:50:38 +0200 Subject: [PATCH] kubectl get --show-labels and -L --- slides/k8s/labels-annotations.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/slides/k8s/labels-annotations.md b/slides/k8s/labels-annotations.md index a295c289..b3245a75 100644 --- a/slides/k8s/labels-annotations.md +++ b/slides/k8s/labels-annotations.md @@ -143,6 +143,30 @@ So, what do we get? --- +## Other ways to view labels + +- `kubectl get` gives us a couple of useful flags to check labels + +- `kubectl get --show-labels` shows all labels + +- `kubectl get -L xyz` shows the value of label `xyz` + +.exercise[ + +- List all the labels that we have on pods: + ```bash + kubectl get pods --show-labels + ``` + +- List the value of label `app` on these pods: + ```bash + kubectl get pods -L app + ``` + +] + +--- + class: extra-details ## More on selectors