Merge pull request #22273 from tengqm/add-jsonpath-tip

Add a kubectl tip for working with keys with dots
pull/22479/head
Kubernetes Prow Robot 2020-07-11 10:25:21 -07:00 committed by GitHub
commit ce84f4e199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -166,6 +166,10 @@ kubectl get pv --sort-by=.spec.capacity.storage
kubectl get pods --selector=app=cassandra -o \
jsonpath='{.items[*].metadata.labels.version}'
# Retrieve the value of a key with dots, e.g. 'ca.crt'
kubectl get configmap myconfig \
-o jsonpath='{.data.ca\.crt}'
# 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'