kubectl get
kubectl get <type> [name] [-n ns | -A] [-o wide|yaml|name|jsonpath=…] [-l key=value] [-w]
Risk: Safe
What it does
Lists objects as a table: pods, deployments, services and more.
When to use it
Any time you want to see what exists right now.
Example
$ kubectl get podsShow my trays and how they are doing.
$ kubectl get pods -o wideAlso show each pod's IP and node.
$ kubectl get deployment shop -o yamlShow the whole object, spec and status.
$ kubectl get pods -l app=shopOnly pods with the label app=shop.
$ kubectl get pods -APods in every namespace.
Learn it in: Drive it with kubectl · Official docs