From 64fc415cdd1d4ee4160b361965a2517eca214de1 Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sun, 17 Feb 2019 15:49:36 +0000 Subject: [PATCH] Illustrate negative-exists selector in cheat sheet (#12667) --- content/en/docs/reference/kubectl/cheatsheet.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index 01ee865510..88b1a86f18 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -146,6 +146,10 @@ kubectl get pods --sort-by='.status.containerStatuses[0].restartCount' kubectl get pods --selector=app=cassandra rc -o \ jsonpath='{.items[*].metadata.labels.version}' +# Get all worker nodes (use a selector to exclude results that have a label +# named 'node-role.kubernetes.io/master') +kubectl get node --selector='!node-role.kubernetes.io/master' + # Get all running pods in the namespace kubectl get pods --field-selector=status.phase=Running