Use kubectl to find Pods, inspect their status and events, read container logs, and—when needed—run commands inside a container or remove a Pod. For production, keep the desired resource configuration in version control and apply it declaratively rather than treating one-off commands as the source of truth.
Before changing anything, confirm the cluster and context
kubectl is the primary command-line tool for communicating with a Kubernetes cluster. It sends requests to the Kubernetes API, and its kubeconfig can contain several clusters, users, and contexts. Check the active context before running commands that could affect workloads:
kubectl config current-context
For production resource management, Kubernetes recommends declarative configuration kept under version control and applied with kubectl apply. This gives the team a record of the intended state instead of relying on ad hoc imperative changes. See the Kubernetes object management guidance.
Find and inspect a Pod
List Pods in the relevant namespace
Start with the current namespace:
kubectl get pods
If the workload is in another namespace, specify it explicitly:
#1 Best Overall
- 【Powerful Load-bearing】12U Network Rack Open Frame is constructed from durable cold rolled steel; Rack shelf supports enhance stability, wall-mounted capacity of 130lbs, the ground-mounted up to 260lbs
- 【Considerate Designs】Open-frame layout, including a top panel adding space, anti-slip shelf stops fixing devices and compatible racks for stack and expansion to meet requirements of home server rack
- 【Complete Accessories】A 12U open frame server rack, two ventilated shelves, four shelf stops, four velcro straps and a set of equipment mounting screws
- 【Versatile Application】Ideal for space-efficient multi-device setups in warehouses, retail, classrooms, offices and more; Excellent choices as AV Rack/IT Rack
- 【Effortless Setup】 Network Rack includes hardware, a comprehensive manual, mounting hole drilling template and an online assembly video to simplify setup
kubectl get pods -n NAMESPACE
Use kubectl get to find the Pod name and check its reported status before inspecting or acting on it. Kubernetes documents namespace-scoped Pod listing in its running Pod debugging guide.
Read Pod details and events
Use describe for a human-readable view of a Pod’s container details and recent events:
kubectl describe pod POD_NAME -n NAMESPACE
Events and container state can help explain what is happening when a Pod is not behaving as expected. The output is intended for people to inspect; it is not a stable format for scripts. For automation, use an API or structured output designed for that purpose.
Rank #2
- Save valuable floor space: 6U wall mount server cabinet Dimensions: 13.78" H x21.65" W x17.72" D.Maximum mounting depth is 14.2"
- Keep critical network equipment secure: glass door and side panels are lockable to prevent unauthorized access. Front door can be installed on either side of the front of the cabinet to satisfy your door swing orientation preference
- Easy equipment configuration: Fully adjustable mounting rails and numbered U positions, with square holes for easy equipment mounting with top and bottom punch-out panels for easy cable access
- Durability: Made of high quality cold rolled steel holds up to 110lb (50kg) (Easy Assembly Required)
- PCI & HIPPA and EIA/ECA-310-E compliant
Read container logs
Specify the container when a Pod has more than one:
Free tools Windows power users keep installed
One-click scans. No signup required.
kubectl logs POD_NAME -c CONTAINER_NAME -n NAMESPACE
After a container restarts or crashes, retrieve the preceding instance’s output with --previous:
kubectl logs POD_NAME -c CONTAINER_NAME --previous -n NAMESPACE
These commands are useful for immediate investigation, but Pod-local logs are not durable records. The kubelet rotates container logs; by default, after a restart one terminated container’s logs remain available, while eviction removes the Pod’s containers and their corresponding logs. Kubernetes recommends making log storage and lifecycle independent of nodes, Pods, and containers. For sustained retention, use centralized logging rather than relying on kubectl logs alone. See the Kubernetes logging architecture.
Rank #3
- Save valuable floor space: 12U wall mount server cabinet Dimensions: 24.25" H x21.65" W x17.72" D. MAXIMUM MOUNTING DEPTH is 14.2".
- Keep critical network equipment secure: glass door and side panels are lockable to prevent unauthorized access; Front door can be installed on either side of the front of the cabinet to satisfy your door swing orientation preference
- Easy equipment configuration: Fully adjustable mounting rails and numbered U positions, with square holes for easy equipment mounting with top and bottom punchout panels for easy cable access
- Durability: Made of high quality cold rolled steel holds up to 110lb (50kg) (Easy Assembly Required)
- PCI & HIPPA and EIA/ECA-310-E compliant
Run a command inside a container
Use exec when you need to run a command in a running container and its image includes that command:
kubectl exec POD_NAME -c CONTAINER_NAME -n NAMESPACE -- COMMAND
For an interactive shell, use sh if the image contains it:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →kubectl exec -it POD_NAME -c CONTAINER_NAME -n NAMESPACE -- sh
Minimal and distroless images may not include a shell or familiar diagnostic tools. In that case, the failure to open a shell does not by itself mean the Pod is unhealthy; it may simply lack the requested utility.
Rank #4
- ADJUSTABLE DEPTH: 4-Post 42U open frame server rack with 4 vertical rails and adjustable mounting depth 22" to 40" (56,0cm to 101,7cm); Compatible with various servers / switches / data / AV and other IT equipment; EIA/ECA-310-E Compliant
- EASY ASSEMBLY: Mobile network rack with easy-to-follow assembly instructions and online video; Compact flat-pack shipping to avoid damage and facilitate installation; Total product height of 80.3in (204 cm) with casters, 78in (198cm) without casters
- COLD ROLLED STEEL: Durable 4 Post 19in open frame rack designed for ventilation with 42U mounting height and 1320lb (600kg) weight capacity (stationary); 3 install options included: casters, levelling feet, or base-plate to secure rack to the floor
- HARDWARE INCLUDED: Rolling computer/data rack includes cage nuts and screws to mount equipment, easy to read Units (U) and depth adjustment markings, cable management hooks for organization, and required assembly tools
- THE IT PRO'S CHOICE: Designed and built for IT Professionals, this 42U rack is backed for 2-years, including free lifetime 24/5 multi-lingual technical assistance
Debug a Pod when its image lacks tools
If exec is insufficient or the container image has no debugging utilities, consider adding an ephemeral debug container with kubectl debug. Ephemeral containers have been stable since Kubernetes v1.25. For the debugging mode that targets another container’s process namespace, the container runtime must support that process targeting.
Choose the method that matches the problem: use logs for recorded output, exec when the target container is running and has the needed command, and an ephemeral container when extra tools are needed. The official running Pod debugging guide describes the available approaches and their requirements.
Delete a Pod carefully
When removal is appropriate, delete the Pod through the API:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 【Powerful load-bearing】 Constructed from durable Cold Rolled Steel, Rack Shelf Back Support enhances stability, wall-mounted capacity of 130lbs, the ground-mounted up to 260lbs
- 【Considerate Designs】Open-frame layout, including a top panel adding space, Anti-Slip Shelf Stops fixing devices and compatible racks for stack and expansion to meet requirements of home server rack
- 【Complete Accessories】A 16U open frame server rack, two ventilated shelves, four shelf stops, four velcro straps and a set of equipment mounting screws
- 【Versatile Application】Ideal for space-efficient multi-device setups in warehouses, retail, classrooms, offices and more; Excellent choices as AV Rack/IT Rack
- 【Effortless Setup】 Network Rack includes hardware, a comprehensive manual, mounting hole drilling template and an online assembly video to simplify setup
kubectl delete pod POD_NAME -n NAMESPACE
Avoid force deletion as a routine shortcut. A force delete does not wait for confirmation that the Pod’s processes have stopped. If its node is unreachable, those processes may keep running until the node observes and completes the deletion. A replacement Pod could then run at the same time as the old process.
This is especially risky if a process uses shared storage or a remote API and identifies itself by Pod name: two active processes with the same identity can cause inconsistent behavior or data corruption. Use force deletion only when termination is certain or duplicate operation is safe. Kubernetes explains the consequences in its Pod termination documentation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Choose the right command for the job
| Need | Command or approach | Important qualification |
|---|---|---|
| Find Pods | kubectl get pods |
Use -n NAMESPACE when the workload is outside the current namespace. |
| Inspect state and recent events | kubectl describe pod POD_NAME |
Human-readable output; not a stable scripting format. |
| Read current container output | kubectl logs POD_NAME -c CONTAINER_NAME |
Useful for immediate investigation, not durable log retention. |
| Read output from the prior container instance | kubectl logs POD_NAME -c CONTAINER_NAME --previous |
Useful after a restart or crash, subject to the available local log lifecycle. |
| Run a command or open a shell | kubectl exec |
The target image must contain the requested command or shell. |
| Debug when the image lacks tools | kubectl debug with an ephemeral container |
Process targeting depends on runtime support; ephemeral containers are stable since v1.25. |
| Remove a Pod | kubectl delete pod POD_NAME |
Do not force-delete casually; processes may continue on an unreachable node. |
Every command shown here is scoped to the relevant namespace where applicable. Keep the active context and target namespace in view before making changes, and use version-controlled declarative configuration for production state.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

