kubernetes
Operate, troubleshoot, secure, upgrade, and automate Kubernetes clusters and workloads safely across upstream Kubernetes, k3s, RKE2, MicroK8s, k0s, Talos, OpenShift/OKD, kind, Minikube, Rancher-managed clusters, EKS, AKS, and GKE. Use when a task involves kubectl, Kubernetes APIs
Install
npx skills add https://github.com/magnus919/agent-skills/tree/main/kubernetes
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install magnus919-agent-skills@llmmart
git clone https://github.com/magnus919/agent-skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole magnus919/agent-skills collection as a plugin from our marketplace. Git is the plain clone.
README
Kubernetes skill
Operate Kubernetes with evidence instead of guesswork. This skill covers upstream Kubernetes and the major self-managed, lightweight, immutable, local, enterprise, and managed-cloud variants, with first-class k3s guidance.
Why Install This Skill
Kubernetes is a distributed control plane, not just a command-line tool. This skill keeps discovery, safety, version drift, and post-change verification in the same operating loop.
What You Get
- A discovery-first operating contract
- Deep references for workloads, networking, security, storage, lifecycle, and troubleshooting
- Distribution overlays, including first-class k3s guidance
- A structured, bounded
k8s-cliwrapper and deterministic tests
Quick Start
scripts/k8s-cli --json doctor
scripts/k8s-cli --json discover
scripts/k8s-cli --json get pods --namespace default
Triggers
Use when operating Kubernetes clusters or workloads, debugging Pods, designing APIs or policies, managing k3s or another distribution, or writing automation around kubectl.
Requirements
kubectl and valid cluster credentials/context are required for live operations. The wrapper does not create credentials or bypass RBAC.
Contents
It includes:
- Discovery-first workflows for clusters, APIs, contexts, namespaces, CRDs, nodes, workloads, and conditions
- Workload, networking, storage, scheduling, autoscaling, security, upgrade, backup, and troubleshooting references
- Distribution overlays for kubeadm/upstream, k3s, RKE2, MicroK8s, k0s, Talos, OpenShift/OKD, kind, Minikube, Rancher, EKS, AKS, and GKE
- A safe, structured
scripts/k8s-cliwrapper that delegates Kubernetes semantics to nativekubectl - Dry-run, confirmation, bounded output, redaction, and post-operation verification patterns
- Dated source and version metadata so stale guidance can be identified
Quick start
scripts/k8s-cli doctor --json
scripts/k8s-cli discover --json
scripts/k8s-cli get pods --namespace default --json
scripts/k8s-cli events --namespace default --json
The wrapper requires kubectl and an already configured kubeconfig or in-cluster environment. It does not create credentials, bypass RBAC, or conceal failed commands.
Scope
This skill is an operational guide and agent-facing command wrapper. It is not a replacement for provider consoles, a Kubernetes client SDK, a policy engine, a CNI/CSI implementation, or a full observability platform. Provider-specific instructions are linked to current official documentation and must be refreshed as releases change.
Skill manifest
Kubernetes
Use this skill as a decision and routing layer. Do not treat it as a static kubectl cheat sheet.
Operating contract
- Identify the target: distribution, provider, cluster version, client version, context, namespace, access mode, and whether the cluster is production.
- Discover before assuming: query served API resources, API versions, CRDs, system workloads, nodes, and distribution markers.
- Separate portable Kubernetes behavior from distribution/provider overlays. Load the matching reference before using lifecycle, networking, identity, storage, or upgrade instructions.
- For mutations, preview first (
k8s-cli ... --dry-runorkubectl diff/ server dry-run), state scope, require explicit confirmation for destructive actions, then verify conditions, events, rollout, and the external boundary. - Prefer stable APIs and server-side validation. Treat beta/alpha APIs, feature gates, provider defaults, and version numbers as time-sensitive.
- Keep evidence bounded and structured. Never dump kubeconfigs, Secret values, tokens, or unbounded logs into chat.
Choose the operating path
| Situation | First move | Do not do |
|---|---|---|
| Live cluster operation | Run doctor, context, and discover; record context, namespace, distribution, and versions |
Do not infer cluster state from configuration or a prior command |
| No cluster access | Produce a bounded plan and name the missing prerequisite | Do not claim a diagnosis, success, or invented command output |
| Any mutation | Render, diff/server-dry-run, state scope, obtain the required confirmation, then mutate and verify the relevant boundary | Do not treat command exit 0 as operational success |
| Provider or distribution present | Load the matching overlay before applying portable guidance | Do not apply upstream instructions unchanged |
First-response discovery
scripts/k8s-cli --json doctor
scripts/k8s-cli --json context
scripts/k8s-cli --json discover
If the wrapper is unavailable, use the equivalent native commands from references/cli-reference.md. If kubectl is absent, stop and report the prerequisite rather than inventing cluster state.
Routing
| Scenario | Load |
|---|---|
| API discovery, SSA, CRDs, or deprecations | references/api-and-versioning.md |
| Workloads, probes, rollouts, jobs, or controllers | references/workloads-and-rollouts.md |
| Scheduling, scaling, storage, node disruption, or reliability | references/scheduling-scaling-storage.md and references/nodes-and-reliability.md |
| Services, DNS, NetworkPolicy, Ingress, or Gateway API | references/networking.md |
Pod is Running but not serving traffic or is absent from Service endpoints |
references/workloads-and-rollouts.md, references/networking.md, references/troubleshooting.md, and the matching distribution overlay |
| RBAC, Pod Security, admission, audit, secrets, or policy engines | references/security-and-policy.md and references/policy.md |
| Evidence-first diagnosis or advanced debugging | references/troubleshooting.md and references/debugging.md |
| Backups, upgrades, HA, or observability | references/operations.md, references/backup-restore.md, and references/observability.md |
| Distribution/provider overlays or version matrix | references/distributions.md, references/version-skew.md, and references/source-index.md |
| Native command details or output contracts | references/cli-reference.md |
| Mutation safety gates | references/safety-gates.md |
Templates and scripts
templates/diagnostic-report.md: human-readable incident reporttemplates/cluster-inventory.json: bounded inventory schematemplates/upgrade-runbook.md: preflight, change, and verification runbookscripts/k8s-cli: agent-first wrapper around kubectlscripts/test-k8s-cli.sh: deterministic tests using a fake kubectlscripts/gather-cluster-state.sh: bounded diagnostic collection for incident reportsscripts/verify-cluster-health.sh: bounded post-operation health verificationscripts/refresh-version-matrix.sh: refreshes dated release observations, never silently edits guidance
Version policy
The research baseline was checked 2026-07-11. The Kubernetes project page reported maintained minors 1.36, 1.35, and 1.34. This is not a permanent claim. Refresh references/distributions.md and the source index before asserting current versions or support status.
Verification boundary
| Claim | Minimum evidence |
|---|---|
| Pod is healthy | Pod conditions, readiness, events, and relevant EndpointSlice or external boundary |
| Pod is serving traffic | Ready condition, Service selector, EndpointSlice membership, events, and a bounded Service-level check |
| Rollout succeeded | Controller conditions, resulting Pods, events, and the relevant Service or external check |
| API/resource is available | Served API discovery, installed CRDs/controller support, and server-side validation |
| Command succeeded operationally | Bounded command result plus the resource condition and user-visible boundary |
A component-level command result is evidence about that component only; do not promote it to a cluster or integration claim.
Hard boundaries
- Never expose Secret data or raw kubeconfig credentials.
- Never use
--force-conflicts,delete,drain,patch,upgrade, or cluster-reset procedures without explaining scope and obtaining the required confirmation. - Never call a Pod
healthyfromRunningalone. - Never call an integration successful from a component-level test alone.
- Never apply an upstream procedure to k3s, RKE2, a managed provider, Talos, or OpenShift without loading its overlay.
Files (agent-skills)
-
evals
-
evals.json 8.5 KB
Loading…
-
-
references
-
api-and-versioning.md 2.6 KB
Loading… -
backup-restore.md 1.8 KB
Loading… -
cli-reference.md 1.6 KB
Loading… -
debugging.md 1.1 KB
Loading… -
distributions.md 3.7 KB
Loading… -
networking.md 1.6 KB
Loading… -
nodes-and-reliability.md 1.5 KB
Loading… -
observability.md 2.3 KB
Loading… -
operations.md 2.1 KB
Loading… -
policy.md 1.3 KB
Loading… -
safety-gates.md 1.1 KB
Loading… -
scheduling-scaling-storage.md 2.7 KB
Loading… -
security-and-policy.md 4.1 KB
Loading… -
source-index.md 2.9 KB
Loading… -
troubleshooting.md 2 KB
Loading… -
version-skew.md 1.1 KB
Loading… -
workloads-and-rollouts.md 2 KB
Loading…
-
-
scripts
-
gather-cluster-state.sh 858 B
Loading… -
k8s-cli 10.5 KB · in bundle
-
refresh-version-matrix.sh 666 B
Loading… -
test-k8s-cli.sh 1 KB
Loading… -
verify-cluster-health.sh 632 B
Loading…
-
-
templates
-
cluster-inventory.json 570 B
Loading… -
deployment.yaml 776 B
Loading… -
diagnostic-report.md 632 B
Loading… -
hpa.yaml 369 B
Loading… -
networkpolicy-default-deny.yaml 179 B
Loading… -
pdb.yaml 188 B
Loading… -
upgrade-runbook.md 999 B
Loading…
-
-
README.md 2.5 KB
# Kubernetes skill Operate Kubernetes with evidence instead of guesswork. This skill covers upstream Kubernetes and the major self-managed, lightweight, immutable, local, enterprise, and managed-cloud variants, with first-class k3s guidance. ## Why Install This Skill Kubernetes is a distributed control plane, not just a command-line tool. This skill keeps discovery, safety, version drift, and post-change verification in the same operating loop. ## What You Get - A discovery-first operating contract - Deep references for workloads, networking, security, storage, lifecycle, and troubleshooting - Distribution overlays, including first-class k3s guidance - A structured, bounded `k8s-cli` wrapper and deterministic tests ## Quick Start ```sh scripts/k8s-cli --json doctor scripts/k8s-cli --json discover scripts/k8s-cli --json get pods --namespace default ``` ## Triggers Use when operating Kubernetes clusters or workloads, debugging Pods, designing APIs or policies, managing k3s or another distribution, or writing automation around kubectl. ## Requirements `kubectl` and valid cluster credentials/context are required for live operations. The wrapper does not create credentials or bypass RBAC. ## Contents It includes: - Discovery-first workflows for clusters, APIs, contexts, namespaces, CRDs, nodes, workloads, and conditions - Workload, networking, storage, scheduling, autoscaling, security, upgrade, backup, and troubleshooting references - Distribution overlays for kubeadm/upstream, k3s, RKE2, MicroK8s, k0s, Talos, OpenShift/OKD, kind, Minikube, Rancher, EKS, AKS, and GKE - A safe, structured `scripts/k8s-cli` wrapper that delegates Kubernetes semantics to native `kubectl` - Dry-run, confirmation, bounded output, redaction, and post-operation verification patterns - Dated source and version metadata so stale guidance can be identified ## Quick start ```sh scripts/k8s-cli doctor --json scripts/k8s-cli discover --json scripts/k8s-cli get pods --namespace default --json scripts/k8s-cli events --namespace default --json ``` The wrapper requires `kubectl` and an already configured kubeconfig or in-cluster environment. It does not create credentials, bypass RBAC, or conceal failed commands. ## Scope This skill is an operational guide and agent-facing command wrapper. It is not a replacement for provider consoles, a Kubernetes client SDK, a policy engine, a CNI/CSI implementation, or a full observability platform. Provider-specific instructions are linked to current official documentation and must be refreshed as releases change. -
SKILL.md 6.2 KB
--- name: kubernetes description: >- Operate, troubleshoot, secure, upgrade, and automate Kubernetes clusters and workloads safely across upstream Kubernetes, k3s, RKE2, MicroK8s, k0s, Talos, OpenShift/OKD, kind, Minikube, Rancher-managed clusters, EKS, AKS, and GKE. Use when a task involves kubectl, Kubernetes APIs, Pods, Deployments, StatefulSets, Services, Ingress or Gateway API, CRDs, RBAC, NetworkPolicy, storage, scheduling, autoscaling, cluster lifecycle, or the bundled agent-first k8s-cli. Do not use this skill for unrelated requests; route to the nearest named specialist. --- # Kubernetes Use this skill as a decision and routing layer. Do not treat it as a static kubectl cheat sheet. ## Operating contract 1. Identify the target: distribution, provider, cluster version, client version, context, namespace, access mode, and whether the cluster is production. 2. Discover before assuming: query served API resources, API versions, CRDs, system workloads, nodes, and distribution markers. 3. Separate portable Kubernetes behavior from distribution/provider overlays. Load the matching reference before using lifecycle, networking, identity, storage, or upgrade instructions. 4. For mutations, preview first (`k8s-cli ... --dry-run` or `kubectl diff` / server dry-run), state scope, require explicit confirmation for destructive actions, then verify conditions, events, rollout, and the external boundary. 5. Prefer stable APIs and server-side validation. Treat beta/alpha APIs, feature gates, provider defaults, and version numbers as time-sensitive. 6. Keep evidence bounded and structured. Never dump kubeconfigs, Secret values, tokens, or unbounded logs into chat. ## Choose the operating path | Situation | First move | Do not do | |---|---|---| | Live cluster operation | Run `doctor`, `context`, and `discover`; record context, namespace, distribution, and versions | Do not infer cluster state from configuration or a prior command | | No cluster access | Produce a bounded plan and name the missing prerequisite | Do not claim a diagnosis, success, or invented command output | | Any mutation | Render, diff/server-dry-run, state scope, obtain the required confirmation, then mutate and verify the relevant boundary | Do not treat command exit 0 as operational success | | Provider or distribution present | Load the matching overlay before applying portable guidance | Do not apply upstream instructions unchanged | ## First-response discovery ```sh scripts/k8s-cli --json doctor scripts/k8s-cli --json context scripts/k8s-cli --json discover ``` If the wrapper is unavailable, use the equivalent native commands from `references/cli-reference.md`. If `kubectl` is absent, stop and report the prerequisite rather than inventing cluster state. ## Routing | Scenario | Load | |---|---| | API discovery, SSA, CRDs, or deprecations | `references/api-and-versioning.md` | | Workloads, probes, rollouts, jobs, or controllers | `references/workloads-and-rollouts.md` | | Scheduling, scaling, storage, node disruption, or reliability | `references/scheduling-scaling-storage.md` and `references/nodes-and-reliability.md` | | Services, DNS, NetworkPolicy, Ingress, or Gateway API | `references/networking.md` | | Pod is `Running` but not serving traffic or is absent from Service endpoints | `references/workloads-and-rollouts.md`, `references/networking.md`, `references/troubleshooting.md`, and the matching distribution overlay | | RBAC, Pod Security, admission, audit, secrets, or policy engines | `references/security-and-policy.md` and `references/policy.md` | | Evidence-first diagnosis or advanced debugging | `references/troubleshooting.md` and `references/debugging.md` | | Backups, upgrades, HA, or observability | `references/operations.md`, `references/backup-restore.md`, and `references/observability.md` | | Distribution/provider overlays or version matrix | `references/distributions.md`, `references/version-skew.md`, and `references/source-index.md` | | Native command details or output contracts | `references/cli-reference.md` | | Mutation safety gates | `references/safety-gates.md` | ## Templates and scripts - `templates/diagnostic-report.md`: human-readable incident report - `templates/cluster-inventory.json`: bounded inventory schema - `templates/upgrade-runbook.md`: preflight, change, and verification runbook - `scripts/k8s-cli`: agent-first wrapper around kubectl - `scripts/test-k8s-cli.sh`: deterministic tests using a fake kubectl - `scripts/gather-cluster-state.sh`: bounded diagnostic collection for incident reports - `scripts/verify-cluster-health.sh`: bounded post-operation health verification - `scripts/refresh-version-matrix.sh`: refreshes dated release observations, never silently edits guidance ## Version policy The research baseline was checked 2026-07-11. The Kubernetes project page reported maintained minors 1.36, 1.35, and 1.34. This is not a permanent claim. Refresh `references/distributions.md` and the source index before asserting current versions or support status. ## Verification boundary | Claim | Minimum evidence | |---|---| | Pod is healthy | Pod conditions, readiness, events, and relevant EndpointSlice or external boundary | | Pod is serving traffic | Ready condition, Service selector, EndpointSlice membership, events, and a bounded Service-level check | | Rollout succeeded | Controller conditions, resulting Pods, events, and the relevant Service or external check | | API/resource is available | Served API discovery, installed CRDs/controller support, and server-side validation | | Command succeeded operationally | Bounded command result plus the resource condition and user-visible boundary | A component-level command result is evidence about that component only; do not promote it to a cluster or integration claim. ## Hard boundaries - Never expose Secret data or raw kubeconfig credentials. - Never use `--force-conflicts`, `delete`, `drain`, `patch`, `upgrade`, or cluster-reset procedures without explaining scope and obtaining the required confirmation. - Never call a Pod `healthy` from `Running` alone. - Never call an integration successful from a component-level test alone. - Never apply an upstream procedure to k3s, RKE2, a managed provider, Talos, or OpenShift without loading its overlay.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.