About kubectl
kubectl is the canonical command-line tool for Kubernetes, used to deploy and manage workloads on clusters. It supports applying manifests, querying cluster state, viewing logs, executing commands in containers, and debugging workloads.
Key features
- 01Apply and manage Kubernetes resources like Deployments, Services, and ConfigMaps
- 02Query the status of Pods, Nodes, and other cluster resources
- 03View container logs, execute commands in Pods, and troubleshoot issues
Use cases
- 01Deploy applications to Kubernetes clusters and manage rolling updates
- 02Monitor and debug applications and Pods running in the cluster
- 03Automate Kubernetes deployments and configuration in CI/CD pipelines
Install
Pick your OS or package manager and run the command in a terminal.
Once installed, runkubectl --versionto confirm it works.
Example commands
Common commands in the order you’d use them.
Details
From the project README⚠️ This is an automatically published staged repository for Kubernetes.
Pull requests, should be made to the main Kubernetes repository: https://github.com/kubernetes/kubernetes.
This repository is read-only for importing, and not used for direct contributions.
See CONTRIBUTING.md for more details.
Kubectl

The k8s.io/kubectl repo is used to track issues for the kubectl cli distributed
with k8s.io/kubernetes. It also contains packages intended for use by client
programs. E.g. these packages are vendored into k8s.io/kubernetes for use in
the kubectl
cli client. That client will eventually move here too.
Contribution Requirements
-
Full unit-test coverage.
-
Go tools compliant (
go get,go test, etc.). It needs to be vendorable somewhere else. -
No dependence on
k8s.io/kubernetes. Dependence on other repositories is fine. -
Code must be usefully commented. Not only for developers on the project, but also for external users of these packages.
-
When reviewing PRs, you are encouraged to use Golang's code review comments page.
-
Packages in this repository should aspire to implement sensible, small interfaces and import a limited set of dependencies.
Community, discussion, contribution, and support
See this document for how to reach the maintainers of this project.
Code of conduct
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.