Cloud Native 4 min read

All Essential Kubernetes Commands – 2026 Updated Guide

This article provides a concise, step‑by‑step reference of the most frequently used kubectl commands for Kubernetes, explaining each command's purpose, typical scenarios, useful options, and the information it reveals to help operators troubleshoot clusters, nodes, pods, deployments, logs, and resources.

Architect Chen
Architect Chen
Architect Chen
All Essential Kubernetes Commands – 2026 Updated Guide

1. View cluster status

kubectl cluster-info

Purpose: Verify that core components such as the API server and DNS are functioning.

Typical scenarios: check cluster availability; troubleshoot control‑plane problems.

2. View node status

kubectl get nodes

Purpose: List all nodes and their Ready/NotReady state.

Extended view: kubectl get nodes -o wide Shows node IP, OS version, container runtime, etc.

3. View Pods

kubectl get pods

Purpose: List Pods in the current namespace.

All namespaces:

kubectl get pods -A

4. Describe a Pod

kubectl describe pod <pod-name>

Purpose: Detailed inspection of a Pod, including events, image‑pull status, restart reasons, and scheduling information.

5. View Deployments

kubectl get deployment

Purpose: Inspect the deployment status of applications.

6. Check rollout status

kubectl rollout status deployment/<name>

Purpose: Verify whether a deployment rollout has completed successfully.

7. Roll back a deployment

kubectl rollout undo deployment/<name>

Purpose: Revert to the previous revision, useful for failed releases or emergency rollbacks.

Applicable scenarios: release failure; production incident rollback.

8. View logs

kubectl logs <pod-name>

Purpose: Stream real‑time logs from a Pod.

Multi‑container Pod:

kubectl logs <pod-name> -c <container-name>

9. Execute a shell in a container

kubectl exec -it <pod-name> -- /bin/bash

If the container image uses Alpine, replace /bin/bash with /bin/sh.

Purpose: Diagnose environment issues and debug the container’s internal state.

10. Delete resources

kubectl delete pod <pod-name>

Purpose: Remove a specific Pod. kubectl delete deployment <name> Purpose: Delete an entire Deployment.

11. Apply YAML configuration

kubectl apply -f app.yaml

Purpose: Create or declaratively update resources defined in a YAML manifest.

Create resources

Update resources (declarative)

12. View all resources

kubectl get all

Purpose: List the most important resource types in the current namespace (Pods, Services, Deployments, ReplicaSets).

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

cloud nativeKubernetestroubleshootingcommand linekubectl
Architect Chen
Written by

Architect Chen

Sharing over a decade of architecture experience from Baidu, Alibaba, and Tencent.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.