All posts
Muhtalip Dede profile photoMuhtalip Dede · Founder of kprompt7 min read

Top 100 Kubernetes prompts (natural language ↔ kubectl)

A tagged hub of ~100 real Kubernetes ops prompts—Operations, Debug, GitOps, Observability, Security, and Multi-cluster—each with a kubectl or tooling note, linked to our cheat sheet, error playbook, and edge-case guide.

This is a breadth hub: ~100 copy-paste kprompt commands across Operations, Debug, GitOps, Observability, Security, and Multi-cluster. It is not a second cheat sheet, not a full incident playbook, and not a deny corpus.

For kubectl ↔ NL one-liners, use the natural-language cheat sheet. For CrashLoop / OOM / ImagePull ladders, use the error prompt playbook. For wipe jokes and --approve traps, use the edge-case guide. Here you get a tagged catalog of shipped-shaped prompts with tool notes.

How to use this hub

  • Copy any row and paste into your shell — NL goes in quotes; -n / --context / --gitops stay outside
  • Reads run immediately; mutates produce a plan — review, then y/N or --approve
  • Run kprompt tools before Prom / Helm / OTel / GitOps diagnoses
  • Needs X in Notes means the integration must be detected — fail clear if missing
  • Experimental — prefer staging while you learn the contract

Jump

  • Operations (§1–22)
  • Debug (§23–42)
  • GitOps (§43–56)
  • Observability (§57–72)
  • Security (§73–86)
  • Multi-cluster (§87–100)

1. Operations

Day-2 mutates and inventory. Pair with the cheat sheet when you only need the kubectl flag shape.

#Commandkubectl / toolNotes
1kprompt "list deployments" -n stagingkubectl get deployRead
2kprompt "list pods" -n stagingkubectl get podsRead
3kprompt "how many nodes are in the cluster"kubectl get nodesRead
4kprompt "list services" -n paymentskubectl get svcRead
5kprompt "list configmaps" -n stagingkubectl get cmRead
6kprompt "describe api" -n stagingkubectl describe deploy/apiRead
7kprompt "logs api" -n stagingkubectl logs deploy/apiRead
8kprompt "scale api to 3" -n stagingkubectl scale … --replicas=3Plan
9kprompt "scale api to 3" -n staging --waitscale + rollout waitPlan
10kprompt "rollback api" -n stagingkubectl rollout undoPlan
11kprompt "deploy redis" -n cacheK8s recipe DeploymentPlan — not Helm
12kprompt "delete deployment redis" -n cachekubectl delete deployNamed only · high risk
13kprompt "install redis" -n cachehelm install …Needs Helm · plan
14kprompt "upgrade nginx to 15.3.2" -n staginghelm upgrade …Needs Helm · version required
15kprompt "add HPA for redis"kubectl autoscale / HPAPlan
16kprompt "create HPA for api min 2 max 8 cpu 60" -n prodHPA createPlan
17kprompt "optimize my cluster"rightsizing reportRead-only report; optional follow-up plan
18kprompt "optimize payments namespace" -n paymentsscoped optimizeRead-only
19kprompt "cleanup payments namespace" -n paymentsorphan findingsPlan if mutate
20kprompt "find unused configmaps and secrets" -n productioncleanupRead / plan
21kprompt "how's my cluster"doctor-styleRead
22kprompt "scale api to 10" -n prod -o jsonPlanResult JSONCI gate pattern

Helm install/upgrade deep dive: plan shapes, dry-run previews, wipe denies.

2. Debug

Investigation-shaped reads. Full CrashLoop / OOM / ImagePull copy-paste ladders stay in the playbook.

#Commandkubectl / toolNotes
23kprompt "explain why api is crashing" -n staginglogs + events ladder→ playbook CrashLoop
24kprompt "explain why payment-api is crashing" -n productionexit 137 path→ OOM guide
25kprompt "explain why deployment api is not ready" -n stagingRS → pods → eventsRead
26kprompt "why is api crashing" -n paymentswhy InvestigationRead
27kprompt "why is ledger Pending" -n paymentsPending cause treeRead
28kprompt "why is worker ImagePullBackOff" -n paymentsEvents / image ref→ ImagePull guide
29kprompt "why is web not ready" -n paymentsreadinessRead
30kprompt "investigate api" -n paymentsService → Endpoints → PodsRead
31kprompt "timeline for api" -n paymentschronologyRead
32kprompt "what happened to ledger" -n paymentstimeline aliasRead
33kprompt "who consumes redis" -n paymentsreverse impactRead
34kprompt "impact of deployment checkout" -n shopblast radiusRead
35kprompt "blast radius for payment-api" -n paymentsimpact JSONRead
36kprompt "find every Deployment using redis" -n paymentssearchRead
37kprompt "search for postgres" -n shopsearchRead
38kprompt "score payments namespace" -n paymentshealth scorecardRead
39kprompt "scorecard for the cluster"cluster scoreRead
40kprompt "explain architecture" -n paymentsarchitecture narrativeRead
41kprompt "what does this cluster look like"platform overviewRead
42kprompt "show service dependency graph" -n paymentsgraph + optional OTelRead

3. GitOps

Flux / Argo CD status and drift are reads. --gitops opens a PR path for supported mutates — not silent cluster apply. Scale/delete stay cluster apply.

#Commandkubectl / toolNotes
43kprompt "show gitops sync status"Flux / Argo CDRead · needs GitOps
44kprompt "gitops status"compact tableRead
45kprompt "check cluster drift"drift InvestigationRead
46kprompt "what is out of sync" -n flux-systemdriftRead
47kprompt "show drift vs git"driftRead
48kprompt "check flux drift" -n flux-systemFlux-flavoredRead
49kprompt "deploy redis" -n demo --gitops --gitops-repo acme/infraPR modeNot cluster apply
50kprompt "deploy api" -n demo --gitops --gitops-repo acme/infra -o jsonPlanResult + PRCI-shaped
51kprompt "install redis" -n demo --gitops --gitops-repo acme/infraHelm template → PRNeeds Helm
52kprompt "rollback api" -n productionrollout undoCluster path; GitOps via controller when wired
53kprompt "show gitops sync status"then approved sync/promoteApprove-gated controller actions
54kprompt "prepare for black friday"recipe: optimize→audit→drift→cleanupMulti-step
55kprompt "helm uninstall --all"expect hard deny→ edge-case guide
56kprompt "train a yolov11 model"Argo WorkflowNeeds Workflow CRD · plan

4. Observability

Prometheus, OpenTelemetry, Grafana, and friends. Missing backends fail clear — they do not invent latency numbers.

#Commandkubectl / toolNotes
57kprompt "why is my api slow?" -n productionProm CPU/mem/latency/HPANeeds Prometheus
58kprompt "why is production slow"perf explainNeeds Prom
59kprompt "show CPU for payment-api pods last hour" -n productionmetrics windowNeeds Prom
60kprompt "trace payment request" -n productionOTel span treeNeeds OTel
61kprompt "show dashboard"GrafanaNeeds Grafana URL/key
62kprompt "optimize my cluster"idle / rightsizing / HPA hintsAlso Ops
63kprompt "show service dependency graph" -n paymentsgraph + OTel edgesDegrades without OTel
64kprompt "watch payments namespace" -n paymentsobserve / watchRead
65kprompt toolscapability detectRun first
66kprompt "scale to zero with keda"ScaledObjectNeeds KEDA · plan
67kprompt "show virtualservice for payments"Istio VSRead-first
68kprompt "show traffic split for payments"Istio readNo write canary claim
69kprompt "create a CI pipeline"Tekton PipelineRunNeeds Tekton · plan
70kprompt "create a CI pipeline for https://github.com/acme/app"Tekton + repoNeeds Tekton
71kprompt "why is api slow then scale api to 4"multi-tool chainOne aggregate approval
72kprompt "show dashboard"then panel summaryAfter Grafana detect

5. Security

Hygiene and audit first. Hard denies for wipe-class prompts are covered in the edge-case guide — listed here only as expect-deny rows.

#Commandkubectl / toolNotes
73kprompt "audit payments namespace" -n paymentshygiene scanRead-only
74kprompt "security scan" -n productionaudit aliasRead-only
75kprompt "audit my cluster"cluster auditRead-only
76kprompt "hygiene check" -n shopauditRead-only
77kprompt "harden production" -n paymentsaudit→optimize→cleanupRecipe · approve
78kprompt "list secrets" -n stagingkubectl get secretsRBAC; avoid value dumps
79kprompt "get secret db-creds" -n prodmetadata-orientedNot a DLP product
80kprompt "delete all pods in production"expect hard deny→ playbook / edge
81kprompt "wipe the staging namespace"expect hard deny→ edge-case
82kprompt "delete deployment redis" -n cachenamed deletePlan · high risk
83kprompt "provision a postgres database"Crossplane claimRiskHigh · strong approval
84kprompt "migrate ingress to gateway api" -n edgeGateway discoverDiscover-only — no auto-rewrite
85kprompt "audit payments" -o jsonPlanResult / reportCI / report-only
86kprompt "harden production" -n paymentsfollow-up privilege fixesApprove each mutate

6. Multi-cluster

Laptop kubeconfig fan-out — not a hosted fleet SaaS. Reads can fan out; multi-context mutates need --approve-each-context. Plain --approve across --contexts is refused.

#Commandkubectl / toolNotes
87kprompt contextskubeconfig inventoryHost
88kprompt contexts --checkAPI reachabilityHost
89kprompt config alias set prod <context>aliasHost
90kprompt --context prod "list deployments"single contextRead
91kprompt --contexts staging,prod "list deployments"read fan-outRead
92kprompt "list pods across staging and prod"NL fan-outRead
93kprompt --contexts staging,prod "optimize my cluster"fleet optimizeRead rollup
94kprompt --contexts staging,prod "investigate api" -n paymentsinvestigate fan-outRead
95kprompt --contexts staging,prod "audit my cluster"audit fan-outRead
96kprompt --contexts staging,prod "explain why api is crashing" -n paymentsexplain fan-outRead
97kprompt --contexts staging,prod "scale api to 3"per-context confirmMutate
98kprompt --contexts staging,prod --approve-each-context "scale api to 3"explicit multi-applyRequired for multi mutate
99kprompt doctor --context stagingper-context doctorRead
100kprompt config set require_alias_match truerefuse mismatch mutateSafety habit

Safety note

  • Hard denies catch wipe-class and unscoped deletes — not the wrong name or wrong context
  • --approve applies the plan you reviewed; it does not make a bad plan safe
  • Multi-context mutates need --approve-each-context
  • Secret values are not a product surface — list carefully under RBAC
  • Crossplane / cloud claims stay RiskHigh

Kyverno / Gatekeeper / Backstage deep posts are later essays — not padded into this count. Istio stays read-first for traffic. MCP kprompt.plan never applies — editor interop is a separate surface.

Try three on staging

Read → investigate → bounded mutate

kprompt tools
kprompt "list pods" -n staging
kprompt "investigate api" -n staging
kprompt "scale api to 3" -n staging
# review plan, then y or --approve

Install path, CI JSON gates, and deeper Helm day-2 when you outgrow the one-liners: