Difference between revisions of "Kubectl get pods -l"
Jump to navigation
Jump to search
(Created page with "{{lc}} kubectl get pods -l app=nginx -L YOUR_LABEL -L or --label-columns {{kubectl get pods}}") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
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}") | ||
{{kubectl get pods}} | {{kubectl get pods}} |
Latest revision as of 17:40, 30 November 2023
kubectl get pods -l app=nginx -L YOUR_LABEL -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}")
kubectl get pods, -l, -n
, Running, Pending, Init
, ContainerCreating, ImagePullBackOff,Init:ImagePullBackOff, Terminating, ErrImagePull, Completed, InvalidImageName, kube-system
, ls_containers.sh
Advertising: