Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

kubectl jq json pod name jsonpath

kubectl get pods -o json
kubectl get pods -o=jsonpath='{@}'
kubectl get pods -o=jsonpath='{.items[0]}'
kubectl get pods -o=jsonpath='{.items[0].metadata.name}'
kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'status.capacity']}"
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"	"}{.status.startTime}{"
"}{end}'
Source by kubernetes.io #
 
PREVIOUS NEXT
Tagged: #kubectl #jq #json #pod #jsonpath
ADD COMMENT
Topic
Name
3+2 =