Skip to content
CLI Tools
Skill

/kubectl

Use when working with the kubectl CLI — Kubernetes command-line tool for managing cluster resources. Covers the command structure, resource types and API groups, kubeconfig and contexts, declarative apply, workload management (deployments, rollout, scale, autoscale, expose),

From plugin
carapace-bin
2k23 skills

Claude Code

$ npx -y skills add carapace-sh/carapace-bin --skill kubectl --agent claude-code

SKILL.md

kubectl.SKILL.md
name: kubectl
description: >
  Use when working with the kubectl CLI — Kubernetes command-line tool for managing cluster
  resources. Covers the command structure, resource types and API groups, kubeconfig and
  contexts, declarative apply, workload management (deployments, rollout, scale, autoscale,
  expose), debugging (logs, exec, port-forward, debug, top), cluster management (cordon,
  drain, taint), output formats (jsonpath, go-template, custom-columns), patches, labels,
  annotations, kustomize, and the plugin system. Triggers on: "kubectl", "kubectl get",
  "kubectl apply", "kubectl create", "kubectl delete", "kubectl describe", "kubectl logs",
  "kubectl exec", "kubectl config", "kubectl rollout", "kubectl scale", "kubectl expose",
  "kubectl port-forward", "kubectl top", "kubectl drain", "kubectl cordon", "kubectl taint",
  "kubectl patch", "kubectl label", "kubectl annotate", "kubectl kustomize", "kubectl wait",
  "kubectl debug", "kubectl explain", "kubeconfig", "kubectl context", "kubectl plugin".
user-invocable: true

kubectl — Kubernetes Command-Line Tool In-Depth Reference

Comprehensive reference for [kubectl](https://kubernetes.io/docs/reference/kubectl/), the CLI for communicating with the Kubernetes control plane. Covers command structure, resource types, kubeconfig, declarative management, workload operations, debugging, cluster administration, and output formatting.

Data Flow

kubectl command
  → parse global flags (--context, --namespace, --kubeconfig, --server)
    → resolve kubeconfig (KUBECONFIG env, ~/.kube/config, in-cluster)
      → authenticate (client cert, token, in-cluster service account)
        → REST request to API server
          → response marshalling (table, json, yaml, jsonpath, go-template)

Sub-Resources

Load the reference that matches your task. When in doubt, load multiple references.

| Keywords | Reference | |----------|----------| | concept, model, control plane, API server, pod, container, deployment, replicaSet, service, namespace, node, kubeconfig, context, cluster, declarative, imperative, reconciliation, controller, reconciliation loop, label, annotation, selector, service account, RBAC, workloads, control plane vs data plane | [references/concepts.md](references/concepts.md) | | resource type, API group, core/v1, apps/v1, batch/v1, networking.k8s.io, rbac, short name, abbreviation, namespaced, cluster-scoped, resource specification, TYPE/NAME, TYPE NAME, api-resources, api-versions, field selector, label selector, resource version, kind, crd, custom resource | [references/resources.md](references/resources.md) | | cli, command, subcommand, command groups, basic commands, intermediate commands, deploy commands, cluster management, troubleshooting, advanced commands, settings commands, global flags, --context, --namespace, --kubeconfig, --server, --as, --as-group, --token, --certificate-authority, verbosity, -v, completion, options, version | [references/cli.md](references/cli.md) | | config, kubeconfig, context, cluster, user, current-context, config view, config use-context, config set-context, config set-cluster, config set-credentials, config get-contexts, config get-clusters, KUBECONFIG, kubeconfig file, merge kubeconfig, named context, default namespace, namespace override | [references/config.md](references/config.md) | | output format, json, yaml, kyaml, name, wide, go-template, go-template-file, jsonpath, jsonpath-as-json, jsonpath-file, custom-columns, custom-columns-file, sort-by, field-selector, template, --output, -o, jsonpath syntax, go template syntax, custom columns syntax, table output, server-print | [references/output.md](references/output.md) | | apply, declarative, server-side apply, client-side apply, last-applied-configuration, prune, dry-run, validate, field-manager, managed fields, conflict, force-conflicts, diff, replace, create, delete, cascade, graceful deletion, save-config, kustomize, kustomization, edit, patch, strategic merge patch, json patch, merge patch, patch type | [references/apply.md](references/apply.md) | | workload, deployment, statefulset, daemonset, replicaset, replicationcontroller, rollout, rollout history, rollout undo, rollout pause, rollout resume, rollout restart, rollout status, scale, autoscale, expose, service, run, set, set image, set env, set resources, set selector, set serviceaccount, set subject, job, cronjob, rolling update, canary | [references/workloads.md](references/workloads.md) | | debugging, logs, exec, attach, cp, port-forward, proxy, top, top node, top pod, describe, events, debug, ephemeral container, wait, condition, troubleshoot, metrics | [references/debugging.md](references/debugging.md) | | cluster management, node, cordon, uncordon, drain, taint, cluster-info, cluster-info dump, certificate, certificate approve, certificate deny, CSR, top node, top pod, metrics-server, auth, auth can-i, auth reconcile, auth whoami, RBAC, role, clusterrole, rolebinding, clusterrolebinding | [references/cluster.md](references/cluster.md) | | plugin, krew, kubectl plugin list, kubectl- prefix, plugin discovery, kubectl plugin, plugin manager, kubectl convert, kubectl alpha, custom plugin, shell plugin, plugin path | [references/plugins.md](references/plugins.md) |

Quick Guide

  • **What is kubectl and how does it connect to a cluster?** → [references/concepts.md](references/concepts.md)
  • **What resource types exist and how do I specify them?** → [references/resources.md](references/resources.md)
  • **What are the command groups and global flags?** → [references/cli.md](references/cli.md)
  • **How do I configure kubeconfig and contexts?** → [references/config.md](references/config.md)
  • **How do I format output with jsonpath or go-templates?** → [references/output.md](references/output.md)
  • **How does `kubectl apply` work vs `kubectl create`?** → [references/apply.md](references/apply.md)
  • **How do I manage deployments and rollouts?** → [references/workl
Read more
@carapace-sh
Ships withcarapace-bin

Carapace-bin provides argument completion for multiple CLI commands (full list), and works across multiple POSIX and non-POSIX shells. Supported shells: Bash Cmd (experimental) Elvish Fish Nushell Oil Powershell Tcsh (experimental) Xonsh Zsh

Stars on GitHub

Momentum

stars in total
2.0k
Star history of carapace-sh/carapace-bin on GitHub, a chart by star-history.com

Other skills on carapace-bin.

brew

brew

Use when working with Homebrew (`brew`) — the package manager for macOS and Linux. Covers the command structure, formula and cask…

bubbletea

bubbletea

Use when working with Bubble Tea (charmbracelet/bubbletea) — the Elm Architecture TUI framework for Go. Covers the…

bun

bun

Use when working with the bun CLI — Bun's all-in-one JavaScript runtime and toolkit. Covers the CLI command reference (install,…

but

but

Use when working with the GitButler CLI (`but`) — virtual branches, stacked branches, workspace model, commit editing (rub,…

carapace

carapace

Use when working with carapace shell completion — integrating into CLIs, writing YAML specs, creating custom actions, building…

cargo

cargo

Use when working with the cargo CLI — Rust's package manager. Covers the manifest format (Cargo.toml), dependencies, features,…

More skills from other plugins.

cli-anything-adguardhome

cli-anything-adguardho…

Command-line interface for AdGuard Home - Network-wide ad blocking and DNS management via AdGuard Home REST API. Designed for AI…

@hkuds@hkudsInstall Skill
find-skills

find-skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a…

skills7d40k
@vercel-labs-2@vercel-labs-2Install Skill
ohmyposh

ohmyposh

Install, configure, or troubleshoot Oh My Posh/ohmyposh: shell init, themes, segments, Nerd Font icons, and prompt setup on…

@jandedobbeleer@jandedobbeleerInstall Skill

Questions about kubectl.

Which coding agents can use kubectl?
kubectl installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.