Difference between revisions of "Kubectl get pods -l"

From wikieduonline
Jump to navigation Jump to search
 
Line 3: Line 3:
 
  kubectl get pods -l app=nginx -L YOUR_LABEL
 
  kubectl get pods -l app=nginx -L YOUR_LABEL
 
  -L or --label-columns
 
  -L or --label-columns
 +
 +
[[kubectl get pods --namespace=default -l app=elasticsearch-master]]
  
 
  export POD_NAME=$([[kubectl get pods --namespace]] default -l "[[app.kubernetes.io/name]]=prometheus,[[app.kubernetes.io/instance]]=prometheus" -o jsonpath="{.items[0].metadata.name}")
 
  export POD_NAME=$([[kubectl get pods --namespace]] default -l "[[app.kubernetes.io/name]]=prometheus,[[app.kubernetes.io/instance]]=prometheus" -o jsonpath="{.items[0].metadata.name}")

Latest revision as of 17:40, 30 November 2023

Advertising: