get
What is get?
get: List resources. The first command you reach for. Add -o wide, -o yaml, or -o json for more detail. kubectl get lists Kubernetes resources. kubectl get pods shows the pods in the current namespace, with their status and age. It is the command you will type most often. Output options add detail. -o wide shows extra columns such as the node and IP address, -o yaml prints the full definition, and -w keeps watching for changes. -A lists resources across all namespaces.
Frequently asked questions about get
What should you keep in mind with get?
Combine types to get an overview in one go, as in kubectl get deploy,svc,ingress. Use labels to filter, such as -l app=web. When a status looks wrong, follow up with kubectl describe and kubectl logs. Setting up shell completion for kubectl makes typing resource names much faster and avoids typos in long pod names.
What does an example of get look like?
kubectl get pods -n prod -o wide kubectl get deploy,svc,ingress At a glance
| Category | Kubernetes |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |