kubectl
TLDR
Get resources
$ kubectl get [pods|deployments|services|nodes]
Describe resource$ kubectl describe [pod] [name]
Apply manifest$ kubectl apply -f [manifest.yaml]
Delete resource$ kubectl delete [pod] [name]
View logs$ kubectl logs [pod-name]
Execute in pod$ kubectl exec -it [pod-name] -- [/bin/bash]
Port forward$ kubectl port-forward [pod-name] [8080:80]
SYNOPSIS
kubectl [options] command [type] [name] [flags]
DESCRIPTION
kubectl is the Kubernetes command-line tool. It communicates with the Kubernetes API to manage cluster resources.
The tool creates, inspects, updates, and deletes workloads. It's the primary interface for cluster administration.
kubectl manages Kubernetes clusters.
PARAMETERS
get TYPE
List resources.describe TYPE NAME
Show resource details.apply -f FILE
Apply configuration.delete TYPE NAME
Delete resource.logs POD
Show pod logs.exec POD
Execute in container.-n NAMESPACE
Target namespace.--help
Display help information.
CAVEATS
Requires kubeconfig. Context determines cluster. RBAC affects access.
HISTORY
kubectl is the official CLI for Kubernetes, developed as the primary cluster management interface.


