Skip to content

Kubernetes Pod inspection

Kubernetes Pod inspection involves the use of command-line tools to list, verify, and interact with containerized workloads.^[400-devops__06-Kubernetes__k8s-learning__08-collect__README.md]

Commands

The fundamental command for inspecting pods is kubectl get pods, which retrieves the current status of Pod resources.^[400-devops__06-Kubernetes__k8s-learning__08-collect__README.md]

For a broader view of cluster resources, kubectl get all can be used with the -owide flag to output detailed information.^[400-devops__06-Kubernetes__k8s-learning__08-collect__README.md]

Local Testing

To inspect application behavior locally, kubectl port-forward can map a remote service to a local port, such as forwarding service/svc-myapp to localhost port 8080.^[400-devops__06-Kubernetes__k8s-learning__08-collect__README.md]

Once forwarded, traffic can be simulated using tools like curl to verify the response.^[400-devops__06-Kubernetes__k8s-learning__08-collect__README.md] For example, repeatedly querying the endpoint might display load balancing across different versions, such as alternating between "Version: v1" and "Version: v2".^[400-devops__06-Kubernetes__k8s-learning__08-collect__README.md]

Sources

^[400-devops__06-Kubernetes__k8s-learning__08-collect__README.md]