## Intro

Kubernetes has become the de facto standard for container orchestration, but its power comes with complexity. For developers and operators, the daily reality is interacting with Pods - the smallest deployable units in a cluster. Whether you are debugging a failing application, scaling a workload, or simply checking the health of your services, knowing the right kubectl commands is essential.

This guide focuses on the most useful Kubernetes Pod commands, explained with practical examples and safe implementation steps. We will cover how to list, inspect, create, update, and delete Pods, along with commands for logs, exec, port-forward, and troubleshooting. Each section includes concrete command snippets with expected output, so you can follow along in your own environment. We'll also discuss verification, failure modes, and recovery strategies to keep your operations smooth.

By the end, you will have a practical cheat sheet to use daily, reducing guesswork and increasing confidence in managing Kubernetes workloads.

## Version and Environment Inventory

Before running any commands, it's important to know what version of Kubernetes and kubectl you are using, as command output and features may vary. This section establishes a consistent baseline for the examples in this guide.

Prerequisites:

- A running Kubernetes cluster (local like minikube, kind, or a cloud-managed cluster)

- kubectl installed and configured to communicate with the cluster

- Basic understanding of Kubernetes concepts like Pods, Deployments, and namespaces

Check kubectl version:

kubectl version --short 
 Expected output (example):

Client Version: v1.27.3
Kustomize Version: v5.0.1
Server Version: v1.27.3 
 Note: Starting from Kubernetes 1.26, --short is deprecated; use kubectl version without flags for full output.

Check cluster info:

kubectl cluster-info 
 Expected output:

Kubernetes control plane is running at https://192.168.49.2:8443
CoreDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy 
 Check nodes:

kubectl get nodes 
 Expected output (example):

NAME STATUS ROLES AGE VERSION
minikube Ready control-plane 10d v1.27.3 
 Important: The examples in this guide use a minikube single-node cluster, but the commands are applicable to any Kubernetes cluster. The default namespace is used unless specified; we'll show how to work across namespaces as well.

<style>
.eno-quiz-widget{margin:2rem 0;padding:1.5rem;border-radius:12px;background:var(--eno-surface-lowest,#f7f7f8);border:1px solid var(--eno-border-soft,#e2e2e6);font-family:var(--eno-font-body,Inter,sans-serif)}
.eno-quiz-widget .eno-quiz-kicker{font-family:var(--eno-font-label,"JetBrains Mono",monospace);font-size:.75rem;letter-spacing:.05em;text-transform:uppercase;color:var(--eno-text-muted,#5f5f68);margin:0 0 .5rem}
.eno-quiz-widget .eno-quiz-question{font-family:var(--eno-font-heading,"Hanken Grotesk",sans-serif);font-size:1.0625rem;font-weight:600;margin:0 0 1rem;color:var(--eno-text-strong,#1a1a1f)}
.eno-quiz-widget .eno-quiz-options{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}
.eno-quiz-widget .eno-quiz-option{display:block;width:100%;min-height:44px;text-align:left;padding:.625rem .875rem;border-radius:8px;border:1.5px solid var(--eno-border-soft,#e2e2e6);background:#fff;font-size:.9375rem;cursor:pointer;transition:border-color var(--eno-motion-base,180ms ease-out),background var(--eno-motion-base,180ms ease-out)}
.eno-quiz-widget .eno-quiz-option:hover{border-color:var(--eno-primary,#0059bb)}
.eno-quiz-widget .eno-quiz-option:focus-visible{outline:none;box-shadow:0 0 0 3px rgb(0 89 187 / 0.15)}
.eno-quiz-widget .eno-quiz-option[aria-pressed="true"]{border-color:var(--eno-primary,#0059bb);background:rgb(0 89 187 / 0.06)}
.eno-quiz-widget .eno-quiz-option[data-correct="true"].eno-quiz-revealed{border-color:var(--eno-success,#17803a);background:rgb(23 128 58 / 0.08)}
.eno-quiz-widget .eno-quiz-option[data-correct="false"].eno-quiz-revealed.eno-quiz-was-selected{border-color:var(--eno-error,#ba1a1a);background:var(--eno-error-soft,#ffdad6)}
.eno-quiz-widget .eno-quiz-option-icon{display:inline-block;width:1.1em;margin-right:.4em;font-weight:700}
.eno-quiz-widget .eno-quiz-submit{margin-top:1rem;min-height:44px;padding:.5rem 1.25rem;border-radius:8px;border:none;background:var(--eno-primary,#0059bb);color:#fff;font-weight:600;font-size:.9375rem;cursor:pointer;transition:opacity var(--eno-motion-base,180ms ease-out)}
.eno-quiz-widget .eno-quiz-submit:disabled{opacity:.5;cursor:not-allowed}
.eno-quiz-widget .eno-quiz-submit:focus-visible{outline:none;box-shadow:0 0 0 3px rgb(0 89 187 / 0.15)}
.eno-quiz-widget .eno-quiz-explanation{margin-top:1rem;padding:.875rem 1rem;border-radius:8px;font-size:.9375rem;line-height:1.5;display:none}
.eno-quiz-widget .eno-quiz-explanation.eno-quiz-visible{display:block}
.eno-quiz-widget .eno-quiz-explanation.eno-quiz-correct{background:rgb(23 128 58 / 0.08);color:var(--eno-success,#17803a)}
.eno-quiz-widget .eno-quiz-explanation.eno-quiz-incorrect{background:var(--eno-error-soft,#ffdad6);color:var(--eno-error,#ba1a1a)}
@media (prefers-reduced-motion: reduce){.eno-quiz-widget *{transition:none!important}}
</style><div class="eno-quiz-widget" role="group" aria-label="Quick check question">
Quick check 1 of 2

Which kubectl subcommand would you use to get detailed information about a resource, including events?

- kubectl get
- kubectl describe
- kubectl logs
- kubectl exec

<button type="button" class="eno-quiz-submit" disabled>Submit</button>
<div class="eno-quiz-explanation">According to the passage, &#39;kubectl get&#39; lists resources, &#39;kubectl describe&#39; shows detailed information about a resource, &#39;kubectl logs&#39; prints logs from a container, and &#39;kubectl exec&#39; executes a command on a container. The command for detailed information is &#39;kubectl describe&#39;.</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
  document.querySelectorAll('.eno-quiz-widget:not([data-eno-quiz-bound])').forEach(function (widget) {
    widget.setAttribute('data-eno-quiz-bound', '1');
    var options = Array.prototype.slice.call(widget.querySelectorAll('.eno-quiz-option'));
    var submitBtn = widget.querySelector('.eno-quiz-submit');
    var explanation = widget.querySelector('.eno-quiz-explanation');
    var selected = null;
    options.forEach(function (opt) {
      opt.addEventListener('click', function () {
        if (widget.hasAttribute('data-eno-quiz-answered')) return;
        options.forEach(function (o) { o.setAttribute('aria-pressed', 'false'); });
        opt.setAttribute('aria-pressed', 'true');
        selected = opt;
        submitBtn.disabled = false;
      });
    });
    submitBtn.addEventListener('click', function () {
      if (!selected || widget.hasAttribute('data-eno-quiz-answered')) return;
      widget.setAttribute('data-eno-quiz-answered', '1');
      submitBtn.disabled = true;
      var correct = selected.getAttribute('data-correct') === 'true';
      options.forEach(function (o) {
        o.classList.add('eno-quiz-revealed');
        if (o === selected) o.classList.add('eno-quiz-was-selected');
        var icon = o.querySelector('.eno-quiz-option-icon');
        if (o.getAttribute('data-correct') === 'true') icon.textContent = '\u2713';
        else if (o === selected) icon.textContent = '\u2717';
      });
      explanation.classList.add('eno-quiz-visible', correct ? 'eno-quiz-correct' : 'eno-quiz-incorrect');
    });
  });
});
</script>

## Safe Configuration Path

When managing Pods, it's crucial to follow safe practices to avoid unintended disruptions. This section explains scoped implementation choices: using namespaces, labels, and dry-run before making changes.

### Namespaces for Isolation

Always operate within a specific namespace, especially in shared clusters. Use -n or --namespace to scope commands. Example: list Pods in the development namespace:

kubectl get pods -n development 
 To list Pods across all namespaces:

kubectl get pods --all-namespaces 

### Labels and Selectors

 Labels allow you to group and select Pods for bulk operations. For example, to get Pods with a specific label:

kubectl get pods -l app=nginx 
 This returns only Pods labeled app=nginx , reducing risk when filtering. You can combine multiple selectors:

kubectl get pods -l app=nginx,environment=production 

### Dry-Run for Validation

 Before applying changes, use --dry-run=client to validate the manifest or command without making changes:

kubectl run nginx --image=nginx --dry-run=client -o yaml 
 This prints the YAML that would be sent to the API server, allowing you to review it. The output starts with apiVersion: v1 and kind: Pod , showing the generated manifest.

### Example: Create a Pod Safely

Instead of imperatively creating a Pod, generate a YAML manifest, review it, then apply:

kubectl run nginx --image=nginx --dry-run=client -o yaml > nginx-pod.yaml
# Edit the file as needed
kubectl apply -f nginx-pod.yaml 
 This approach aligns with GitOps practices and allows version control of your workloads. Always prefer declarative manifests in production.

## Verification and Diagnostics

After creating or modifying Pods, you need to verify their state and diagnose issues. This section covers the essential commands for observability.

### List Pods

Basic listing:

kubectl get pods 
 Expected output:

NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 5m 
 For more detail, use wide output:

kubectl get pods -o wide 
 This shows node, IP, and more. Example output:

NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx 1/1 Running 0 5m 10.244.0.5 minikube <none> <none> 
 To watch changes live:

kubectl get pods -w 
 This streams updates until you press Ctrl+C.

### Describe a Pod

For detailed information including events:

kubectl describe pod nginx 
 Look for the Events section at the end to see scheduling, image pulling, and container starts. The output includes container statuses, conditions, and volumes. Example snippet:

Events:
 Type Reason Age From Message
 ---- ------ ---- ---- -------
 Normal Scheduled 5m default-scheduler Successfully assigned default/nginx to minikube
 Normal Pulling 5m kubelet Pulling image "nginx"
 Normal Pulled 5m kubelet Successfully pulled image "nginx"
 Normal Created 5m kubelet Created container nginx
 Normal Started 5m kubelet Started container nginx 

### Get Pod Logs

 View logs from a container:

kubectl logs nginx 
 If multiple containers, specify container name:

kubectl logs nginx -c nginx-container 
 Follow logs with -f :

kubectl logs -f nginx 
 To see logs from a specific time period:

kubectl logs nginx --since=1h 

### Execute Commands in a Container

 Run a shell inside the Pod:

kubectl exec -it nginx -- /bin/bash 
 If the image does not have bash, try sh . Run a single command without interactive shell:

kubectl exec nginx -- ls / 
 Expected output (example):

bin dev etc home proc root sys tmp usr var 
 You can also set environment variables for the exec session:

kubectl exec nginx -- env 

### Port Forwarding

 Access a Pod's port locally:

kubectl port-forward pod/nginx 8080:80 
 Now you can browse http://localhost:8080. The command runs in the foreground; use & to background it or open another terminal.

To bind to a specific address:

kubectl port-forward --address 0.0.0.0 pod/nginx 8080:80 

### Check Resource Usage

 If metrics-server is installed:

kubectl top pod nginx 
 Expected output:

NAME CPU(cores) MEMORY(bytes)
nginx 1m 4Mi 
 For all Pods in a namespace:

kubectl top pod -n development 
 If metrics-server is not installed, you'll get an error: error: Metrics API not available . Install it using kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml (see official docs for your cluster).

<style>
.eno-quiz-widget{margin:2rem 0;padding:1.5rem;border-radius:12px;background:var(--eno-surface-lowest,#f7f7f8);border:1px solid var(--eno-border-soft,#e2e2e6);font-family:var(--eno-font-body,Inter,sans-serif)}
.eno-quiz-widget .eno-quiz-kicker{font-family:var(--eno-font-label,"JetBrains Mono",monospace);font-size:.75rem;letter-spacing:.05em;text-transform:uppercase;color:var(--eno-text-muted,#5f5f68);margin:0 0 .5rem}
.eno-quiz-widget .eno-quiz-question{font-family:var(--eno-font-heading,"Hanken Grotesk",sans-serif);font-size:1.0625rem;font-weight:600;margin:0 0 1rem;color:var(--eno-text-strong,#1a1a1f)}
.eno-quiz-widget .eno-quiz-options{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}
.eno-quiz-widget .eno-quiz-option{display:block;width:100%;min-height:44px;text-align:left;padding:.625rem .875rem;border-radius:8px;border:1.5px solid var(--eno-border-soft,#e2e2e6);background:#fff;font-size:.9375rem;cursor:pointer;transition:border-color var(--eno-motion-base,180ms ease-out),background var(--eno-motion-base,180ms ease-out)}
.eno-quiz-widget .eno-quiz-option:hover{border-color:var(--eno-primary,#0059bb)}
.eno-quiz-widget .eno-quiz-option:focus-visible{outline:none;box-shadow:0 0 0 3px rgb(0 89 187 / 0.15)}
.eno-quiz-widget .eno-quiz-option[aria-pressed="true"]{border-color:var(--eno-primary,#0059bb);background:rgb(0 89 187 / 0.06)}
.eno-quiz-widget .eno-quiz-option[data-correct="true"].eno-quiz-revealed{border-color:var(--eno-success,#17803a);background:rgb(23 128 58 / 0.08)}
.eno-quiz-widget .eno-quiz-option[data-correct="false"].eno-quiz-revealed.eno-quiz-was-selected{border-color:var(--eno-error,#ba1a1a);background:var(--eno-error-soft,#ffdad6)}
.eno-quiz-widget .eno-quiz-option-icon{display:inline-block;width:1.1em;margin-right:.4em;font-weight:700}
.eno-quiz-widget .eno-quiz-submit{margin-top:1rem;min-height:44px;padding:.5rem 1.25rem;border-radius:8px;border:none;background:var(--eno-primary,#0059bb);color:#fff;font-weight:600;font-size:.9375rem;cursor:pointer;transition:opacity var(--eno-motion-base,180ms ease-out)}
.eno-quiz-widget .eno-quiz-submit:disabled{opacity:.5;cursor:not-allowed}
.eno-quiz-widget .eno-quiz-submit:focus-visible{outline:none;box-shadow:0 0 0 3px rgb(0 89 187 / 0.15)}
.eno-quiz-widget .eno-quiz-explanation{margin-top:1rem;padding:.875rem 1rem;border-radius:8px;font-size:.9375rem;line-height:1.5;display:none}
.eno-quiz-widget .eno-quiz-explanation.eno-quiz-visible{display:block}
.eno-quiz-widget .eno-quiz-explanation.eno-quiz-correct{background:rgb(23 128 58 / 0.08);color:var(--eno-success,#17803a)}
.eno-quiz-widget .eno-quiz-explanation.eno-quiz-incorrect{background:var(--eno-error-soft,#ffdad6);color:var(--eno-error,#ba1a1a)}
@media (prefers-reduced-motion: reduce){.eno-quiz-widget *{transition:none!important}}
</style><div class="eno-quiz-widget" role="group" aria-label="Quick check question">
Quick check 2 of 2

What is the smallest and simplest unit in the Kubernetes object model that you create or deploy?

- Deployment
- Service
- Pod
- Node

<button type="button" class="eno-quiz-submit" disabled>Submit</button>
<div class="eno-quiz-explanation">The passage states: &#39;A Pod is the basic building block of Kubernetes–the smallest and simplest unit in the Kubernetes object model that you create or deploy.&#39;</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
  document.querySelectorAll('.eno-quiz-widget:not([data-eno-quiz-bound])').forEach(function (widget) {
    widget.setAttribute('data-eno-quiz-bound', '1');
    var options = Array.prototype.slice.call(widget.querySelectorAll('.eno-quiz-option'));
    var submitBtn = widget.querySelector('.eno-quiz-submit');
    var explanation = widget.querySelector('.eno-quiz-explanation');
    var selected = null;
    options.forEach(function (opt) {
      opt.addEventListener('click', function () {
        if (widget.hasAttribute('data-eno-quiz-answered')) return;
        options.forEach(function (o) { o.setAttribute('aria-pressed', 'false'); });
        opt.setAttribute('aria-pressed', 'true');
        selected = opt;
        submitBtn.disabled = false;
      });
    });
    submitBtn.addEventListener('click', function () {
      if (!selected || widget.hasAttribute('data-eno-quiz-answered')) return;
      widget.setAttribute('data-eno-quiz-answered', '1');
      submitBtn.disabled = true;
      var correct = selected.getAttribute('data-correct') === 'true';
      options.forEach(function (o) {
        o.classList.add('eno-quiz-revealed');
        if (o === selected) o.classList.add('eno-quiz-was-selected');
        var icon = o.querySelector('.eno-quiz-option-icon');
        if (o.getAttribute('data-correct') === 'true') icon.textContent = '\u2713';
        else if (o === selected) icon.textContent = '\u2717';
      });
      explanation.classList.add('eno-quiz-visible', correct ? 'eno-quiz-correct' : 'eno-quiz-incorrect');
    });
  });
});
</script>

## Failure Modes and Recovery

Pods can fail for various reasons: image pull errors, crashes, resource limits, or node issues. Knowing how to identify and recover is critical.

### Common Failure Modes

- ImagePullBackOff : The image cannot be pulled (wrong name, private registry auth, network).

- CrashLoopBackOff : Container starts then exits repeatedly, often due to application error.

- Pending : Pod cannot be scheduled, often due to insufficient resources.

- OOMKilled : Container exceeded memory limit and was killed.

### Diagnosis Commands

- kubectl describe pod <name> : check Events and State.

- kubectl logs <name> --previous : get logs from previous crashed container instance.

- kubectl get events --field-selector involvedObject.name=: list cluster events related to the Pod.

 Example for events:

kubectl get events --field-selector involvedObject.name=nginx 

### Example: Debug CrashLoopBackOff

- Describe pod: kubectl describe pod myapp-7d9f8c5b-xyz

- Check events: you might see Back-off restarting failed container .

- Check logs: kubectl logs myapp-7d9f8c5b-xyz --previous to see why it exited.

- If it's a config error, fix the ConfigMap or Secret and reapply.

 For example, if the container exits with code 1 due to missing environment variable, edit the Deployment to add the variable, then apply:

kubectl edit deployment myapp
# or modify manifest and kubectl apply -f deployment.yaml 

### Recovery Actions

- Delete and recreate the Pod (if managed by a Deployment, it will be automatically recreated).

- Roll back a Deployment to a previous revision: kubectl rollout undo deployment/myapp .

- Scale down to zero and back up if needed.

- Adjust resource limits in the Pod spec to prevent OOMKilled.

 Example: Check rollout history:

kubectl rollout history deployment/myapp 
 Then rollback to a specific revision:

kubectl rollout undo deployment/myapp --to-revision=2 
 Important: Never edit a Pod directly (except for debugging with kubectl edit pod ). Pods are immutable; use controllers like Deployments for updates.

## Operations Checklist

Use this checklist for daily Pod operations to ensure consistency and safety.

<div class="my-stack-md overflow-x-auto">
<table class="min-w-[42rem] border-collapse text-left">
<thead><tr><th scope="col" class="border border-outline-variant bg-surface-container-low px-4 py-3 text-left font-label-md font-semibold text-on-surface">Task</th><th scope="col" class="border border-outline-variant bg-surface-container-low px-4 py-3 text-left font-label-md font-semibold text-on-surface">Command</th><th scope="col" class="border border-outline-variant bg-surface-container-low px-4 py-3 text-left font-label-md font-semibold text-on-surface">Notes</th></tr></thead>
<tbody><tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">List Pods in namespace</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl get pods -n &lt;namespace&gt;</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Basic overview</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">List with labels</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl get pods -l app=myapp</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Filter by label</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Describe a Pod</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl describe pod &lt;name&gt;</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Detailed status and events</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">View logs</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl logs &lt;name&gt; -f</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Follow logs</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Execute command</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl exec -it &lt;name&gt; -- /bin/sh</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Interactive shell</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Port forward</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl port-forward pod/&lt;name&gt; &lt;local&gt;:&lt;remote&gt;</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Local access</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Delete a Pod</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl delete pod &lt;name&gt;</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">If managed, it will be recreated</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Delete with grace period</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl delete pod &lt;name&gt; --grace-period=30</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Allow time for cleanup</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Force delete (stuck)</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl delete pod &lt;name&gt; --force --grace-period=0</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Last resort</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Top resource usage</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl top pod &lt;name&gt;</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Requires metrics-server</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Check events</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl get events --sort-by=.metadata.creationTimestamp</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Recent cluster events</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Rollout restart</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl rollout restart deployment/&lt;name&gt;</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Restart Pods in a Deployment</td></tr>
<tr><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Scale Deployment</td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant"><code class="font-mono text-[0.9em] bg-surface-container px-1 py-0.5 rounded">kubectl scale deployment/&lt;name&gt; --replicas=3</code></td><td class="border border-outline-variant px-4 py-3 align-top text-body-md text-on-surface-variant">Adjust replicas</td></tr></tbody>
</table>
</div>
Review Steps:

- Always specify namespace when in doubt.

- Prefer declarative manifests ( apply -f ) over imperative commands for production.

- Use --dry-run=client before making changes.

- Monitor Pod status after any change.

- Use labels and selectors to avoid acting on unintended Pods.

## Conclusion

Mastering basic Kubernetes Pod commands is essential for anyone working with containerized applications. In this guide, we covered the fundamental commands for listing, inspecting, creating, debugging, and deleting Pods, with safe practices and real-world examples. By following the version inventory, safe configuration path, verification methods, and recovery strategies, you can operate Kubernetes clusters with confidence.

The key takeaways:

- Use kubectl get , describe , and logs for daily observation.

- Use exec and port-forward for debugging and local access.

- Always scope commands with namespaces and labels.

- Prefer declarative manifests and dry-run for changes.

- Know how to diagnose and recover from common Pod failures.

Next steps: practice these commands in a sandbox environment, start with a single Pod, then move to Deployments and more complex workloads. Use the operations checklist as a quick reference. With these skills, you'll be well-equipped to manage Kubernetes Pods in production.