lab03: Exploring Pods and Nodes
When working with Kubernetes, managing and exploring Pods and Nodes is crucial. Here's a quick guide on using kubectl commands for these tasks:
Pods:
- Listing Pods Across All Namespaces: To see every Pod running across all namespaces in your cluster, use:
kubectl get pods --all-namespaces
- Listing Pods Within a Specific Namespace: If you want to focus on Pods within a particular namespace, modify your command like so:
kubectl get pods -n <namespace>
- Describing a Pod: For detailed information about a specific Pod, including its status and events, use the describe command:
kubectl describe pod <pod-name> -n <namespace>
Nodes:
- Listing All Nodes: To get a list of all Nodes in your cluster, along with their status, use:
kubectl get nodes
- Describing a Node: For a deep dive into a specific Node's details, including the Pods running on it and its available resources, use:
kubectl describe node <node-name>