Kubernetes Most-Used Commands

☸ Kubernetes · kubectl · Weisewelt

Premium Kubernetes Emulator: 50 explained kubectl commands

Run the emulator, copy a command from the table, and watch the text output plus the node canvas to understand which resource moves, where it runs, and what changes inside the cluster.

☸ Safe learning mode

Premium Kubernetes Emulator

Learn Kubernetes by running simulated commands with terminal output, explanations and node canvas.

FREE active LITE coming soon PRO coming soon PRO Plus coming soon
kubectl terminalcontext: ww-training / Profile: learner-admin
$
Execution outputkubectl simulator
Node canvasDetected resources

🔒 This emulator does not connect to a real cluster. It simulates kubectl for safe learning.

How to use it

  • Run the commands in order first so resources exist before checking services, endpoints, HPA or ingress.
  • The node canvas shows pods, private IPs, services, profile and simulated permissions.
  • The lab is safe: it does not connect to a real cluster.
50explained commands
12guided challenges

Responsive kubectl command table

#CategoryCommandExplanationAction
1Basicskubectl version --clientShows the local kubectl client version to validate client compatibility.
2Basicskubectl cluster-infoShows control plane and main cluster service information.
3Contextkubectl config current-contextShows the active context where kubectl will send commands.
4Contextkubectl config get-contextsLists configured contexts, user, cluster and associated namespace.
5Security/RBACkubectl auth can-i get podsChecks whether the current profile can list pods according to RBAC.
6APIkubectl api-resourcesLists available resources, aliases, API version and namespace scope.
7APIkubectl api-versionsShows available API versions for compatible manifests.
8APIkubectl explain podExplains the structure and main fields of the Pod resource.
9Nodeskubectl get nodesLists cluster nodes and their Ready/NotReady state.
10Nodeskubectl describe node ww-node-02Shows capacity, conditions, role and private IP of the worker node.
11Nodeskubectl top nodesShows simulated CPU and memory metrics by node.
12Namespaceskubectl get namespacesLists namespaces available in the cluster.
13Namespaceskubectl create namespace ww-labCreates a lab namespace to isolate resources.
14Namespaceskubectl label namespace ww-lab environment=trainingAdds a label to the namespace for classification and filtering.
15Contextkubectl config set-context --current --namespace=ww-labSets ww-lab as the default namespace for the current context.
16Podskubectl get pods -ALists pods across all namespaces, including kube-system.
17Podskubectl get podsLists pods in the current namespace.
18Podskubectl get pods -o wideShows pods with private IP and assigned node.
19Podskubectl get pods --show-labelsLists pods with labels to understand selectors and service relationships.
20Workloadskubectl create deployment web --image=nginx:1.27Creates a Deployment named web using the nginx image.
21Workloadskubectl get deploymentsLists deployments and available replicas.
22Workloadskubectl describe deployment webShows Deployment details, image, strategy and replicas.
23Workloadskubectl scale deployment web --replicas=3Scales the Deployment to three replicas distributed across nodes.
24Workloadskubectl get rsLists ReplicaSets created by the Deployment.
25Networking/Serviceskubectl expose deployment web --port=80 --target-port=80Creates a ClusterIP Service to route internal traffic to pods.
26Networking/Serviceskubectl get svcLists services and internal cluster IPs.
27Networking/Serviceskubectl describe svc webShows selector, ports and endpoints of the web service.
28Networking/Serviceskubectl get endpointsLists private endpoints targeted by the Service.
29Troubleshootingkubectl logs -l app=webQueries logs from pods matching the app=web label.
30Troubleshootingkubectl describe pod web-7d8bShows events, state and details for the simulated pod.
31Metricskubectl top podsShows simulated CPU and memory usage by pod.
32Operationskubectl exec deploy/web -- nginx -vRuns a command inside the Deployment container.
33Updateskubectl set image deployment/web nginx=nginx:1.28Updates the Deployment image and triggers a rolling update.
34Updateskubectl rollout status deployment/webChecks whether the rollout completed successfully.
35Updateskubectl rollout history deployment/webShows the Deployment revision history.
36Updateskubectl rollout undo deployment/webRolls the Deployment back to the previous version.
37Configurationkubectl create configmap web-config --from-literal=ENV=trainingCreates a ConfigMap with non-sensitive configuration.
38Configurationkubectl get configmapLists ConfigMaps in the current namespace.
39Configurationkubectl describe configmap web-configShows keys and values in the simulated ConfigMap.
40Secretskubectl create secret generic web-secret --from-literal=API_KEY=demoCreates a generic Secret to represent sensitive data.
41Secretskubectl get secretLists Secrets without exposing values.
42Secretskubectl describe secret web-secretDescribes the Secret while masking sensitive values.
43Autoscalingkubectl autoscale deployment web --cpu-percent=70 --min=2 --max=6Creates a simulated HPA to scale by CPU.
44Autoscalingkubectl get hpaLists the HPA, CPU target and current replicas.
45Autoscalingkubectl describe hpa webShows metric details, minimum and maximum replicas.
46Ingresskubectl apply -f ingress-web.yamlApplies a simulated Ingress manifest to expose HTTP.
47Ingresskubectl get ingressLists Ingress, host, class and entry address.
48Ingresskubectl describe ingress web-ingressDescribes host/path rules that route to the web Service.
49Troubleshootingkubectl get eventsLists recent events useful for diagnosing scheduling and startup.
50Cleanupkubectl delete namespace ww-labDeletes the namespace and cleans up lab resources.