kubectl
kubernetes command-line tool
TLDR
Get resources
SYNOPSIS
kubectl [options] command [type] [name] [flags]
DESCRIPTION
kubectl is the official command-line interface for Kubernetes, used to communicate with the cluster's API server to manage and inspect resources. It supports the full lifecycle of Kubernetes objects, including creating, reading, updating, and deleting resources such as pods, deployments, services, configmaps, and more through declarative manifests or imperative commands.
The tool reads connection details from a kubeconfig file, which defines clusters, users, and contexts that determine which cluster and namespace kubectl targets. Beyond basic resource management, kubectl provides capabilities for debugging with log retrieval and exec sessions, scaling workloads, rolling out updates, port-forwarding to pods, and applying configuration changes from YAML or JSON manifests. Role-based access control (RBAC) on the cluster side governs what operations each authenticated user may perform.
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.
