Skip to content
NSNormandin SystemsTHE EVERYDAY TOOLBOXMain site
</>

Development / YOUR EVERYDAY TOOLBOX

K8s Cheatsheet

Kubernetes useful commands

✓ Free to use✓ No account neededHow to use this tool ↓
YOUR WORKSPACESee an example ↗

Opening your tool…

Runs in your browser. Check important results and keep a copy of your original files.

THE PRACTICAL GUIDE · NORMANDIN SYSTEMS

Get more from K8s Cheatsheet

K8s Cheatsheet summarizes useful Kubernetes commands for inspecting resources and understanding cluster state. Kubernetes commands act through a selected context and often a namespace. A resource name alone may be ambiguous across environments, so context awareness is essential before moving from inspection to an operation that changes a workload. A cheatsheet works best as a memory aid while you practice a concrete task. Read the command or syntax together with its arguments, placeholders, and surrounding context. Similar-looking options can have very different meanings, and an example written for one platform or version may need adjustment elsewhere. Keep the reference beside a small test case, use read-only examples first when possible, and check the relevant help output before applying an unfamiliar command to valuable files or a running service.

Guide updated October 13, 2026

How to use this tool

  1. Identify the operation you want to perform and find the matching section of the reference. Read the whole example before copying any part of it.
  2. Confirm the current context and namespace, then choose a read-only command for the resource you need to inspect.
  3. Review the example below and compare its expected behavior with a small sample of your own input before continuing.
  4. Try the adapted example on a small test case, compare the result with the explanation, and save the command with a note about the context in which it works.

SEE IT IN PRACTICE

A worked example

EXAMPLE INPUT
kubectl get pods -n demo
RESULT / WHAT TO EXPECT
A listing of pods in the demo namespace of the current context

The namespace narrows the resource selection; the context still determines which cluster receives the request.

Context and namespace establish the target

A kubectl command uses the selected cluster context and often a default namespace. A familiar resource name can exist in several environments, so make the target explicit when consequences matter. Inspect configuration and use namespace flags deliberately rather than relying on a remembered terminal state. Labels can narrow a query across related resources, but a selector also needs review to avoid including unrelated workloads. A short command is only safe to interpret once its target context is understood.

Status, events, and application behavior complement each other

A resource status summarizes one part of the system, while events and logs provide clues about scheduling, image pulls, probes, and application errors. A Running pod is not necessarily ready to serve traffic, and a healthy container does not prove that a Service selector routes to it. Follow the relationship from workload to pod to service when debugging connectivity. Use read-only inspection first, then make a focused change based on the actual evidence rather than restarting resources repeatedly without a diagnosis.

When this tool is useful

  • Find a Kubernetes inspection command
  • Review namespace-aware resource selection
  • Understand workload troubleshooting steps

Tips for a better result

  • Check context, namespace, resource kind, and labels, and compare events with resource status when diagnosing a failure.
  • Replace example paths, identifiers, and names deliberately. Copying a reference command unchanged can target a different file, branch, service, or environment from the one you intended.
  • Keep the source and the settings used for this result together. That makes a later comparison or correction easier, especially when another person needs to reproduce the same outcome.

Frequently asked questions

Why confirm the Kubernetes context before a command?

A copied command can affect a different cluster if your current context is wrong. Deletion, apply, scale, and rollout operations deserve an explicit target review.

Does this page execute the examples?

The cheatsheet is a reference. You read its examples and use them in your own editor, terminal, or application. Understand the effect and adapt placeholders before running commands in an environment that contains important data.

What if an example behaves differently on my system?

Check your installed version, platform, shell, and configuration. Read the command help or language documentation for that environment. References summarize common behavior, while available options and defaults can vary between implementations.

What happens to the information I enter?

The utility processes your input in this browser. Some tools retain field values in browser storage or the URL; avoid entering secrets in shareable fields. Page and asset requests still go to the hosting provider. Read the privacy and offline-use notes for details.