← Back to registry

kubectl cloud

Kubernetes command-line tool for cluster management

kubectl is the official Kubernetes CLI for managing clusters, deploying applications, inspecting resources, and viewing logs. It is the primary interface for interacting with any Kubernetes cluster.

Features

Install

brew: brew install kubectl
apt: sudo apt-get install -y kubectl
curl: curl -LO https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl

Commands

CommandSyntaxDescription
get kubectl get <resource> List resources (pods, services, deployments, etc.)
apply kubectl apply -f <file> Apply a configuration from a YAML/JSON file
logs kubectl logs <pod> Stream logs from a running pod
exec kubectl exec -it <pod> -- <command> Execute a command inside a running container

Links

Agent Usage Example

Use cases:

Example workflow:

kubectl get pods -n production --no-headers | grep -v Running && kubectl logs <failing-pod> --tail=50