kubectl

CLI

Kubernetes command-line tool for controlling clusters.

Control Kubernetes clusters: deploy, inspect, and manage workloads

4 curated recipes · not yet executed by the harness#kubernetes#k8s#containers#orchestration

Recipes

Curated from documentation and usage. Percentages are estimates, not measurements.

List all pods in namespace

~99% est.
kubectl get pods -n namespace

Tail logs from a pod

~98% est.
kubectl logs -f pod-name -n namespace

Apply manifest file

~97% est.
kubectl apply -f deploy.yaml

Get shell in running pod

~95% est.
kubectl exec -it pod-name -- /bin/bash
Common failures (1)
  • OCI runtime errorUse /bin/sh if bash is not installed in the container

Install

Homebrewbrew install kubectl

Agent notes

When to use
Managing Kubernetes resources, debugging pods, checking cluster state
Quick examples
  • kubectl get pods
  • kubectl apply -f deploy.yaml
  • kubectl 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.

Homepage ↗Apache-2.00 views