kubectl
CLIKubernetes command-line tool for controlling clusters.
Control Kubernetes clusters: deploy, inspect, and manage workloads
Recipes
Curated from documentation and usage. Percentages are estimates, not measurements.
List all pods in namespace
kubectl get pods -n namespaceTail logs from a pod
kubectl logs -f pod-name -n namespaceApply manifest file
kubectl apply -f deploy.yamlGet shell in running pod
kubectl exec -it pod-name -- /bin/bashCommon failures (1)
- OCI runtime errorUse /bin/sh if bash is not installed in the container
Install
Homebrew
brew install kubectlAgent notes
- When to use
- Managing Kubernetes resources, debugging pods, checking cluster state
- Quick examples
kubectl get podskubectl apply -f deploy.yamlkubectl logs -f pod-name
Use from an agent
curl -s https://clihub.com/api/tools/kubectl | jq '.agentHints.provenRecipes[] | {task, command, verified}'Or call get_tool with slug kubectl on the MCP server at https://clihub.com/mcp.