# kubectl

> The command-line tool for Kubernetes. It reads, creates and changes what runs in a cluster.

**Field:** Infrastructure  
**Category:** Container Orchestration  
**Also known as:** Kube Control, kubectl apply, kubectl get pods

## Think of it like

It is like a TV remote for Kubernetes. You press buttons here, and the cluster does the work.

## Definition

kubectl is the command-line tool for talking to a Kubernetes cluster. You type a command, and it sends the request to the control plane. kubectl get lists things, like pods or deployments. kubectl apply sends a file that describes what should run. kubectl logs shows what a container printed. It reads a small config file to know which cluster to talk to.

## Example

Emma sends her deployment file with one kubectl line. A moment later, kubectl shows her three pods are ready.

## Example code

```console
$ kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml
deployment.apps/nginx-deployment created
```

One file goes in, and the cluster says it made the deployment. The pods start a moment later.

## Why it matters

Almost every Kubernetes guide and fix starts with a kubectl line. It is the first tool to learn.

## Common mistake

Running a command against the wrong cluster. Check which one kubectl points at before you delete anything.

## Three principles

- **Talks to the brain.** Every command goes to the control plane.
- **Get, apply, logs.** Look, change, then check what happened.
- **Knows its cluster.** A config file says where it points.

## Related terms

- [Kubernetes (K8s)](https://learn.benibix.com/term/infrastructure/kubernetes)
- [Kubernetes Cluster](https://learn.benibix.com/term/infrastructure/kubernetes-cluster)
- [Kubernetes Deployment](https://learn.benibix.com/term/infrastructure/kubernetes-deployment)
- [Helm](https://learn.benibix.com/term/infrastructure/helm)
- [Command Line](https://learn.benibix.com/term/infrastructure/command-line)

![A large box marked cluster. At the top sits the control plane. Below it are three nodes in a row. Each node holds pods, and each pod holds one or two containers. On the left, outside the cluster, a person types kubectl commands, and an arrow runs from them to the control plane.](https://learn.benibix.com/diagrams/inf-k8s-cluster.svg)

---

Source: https://learn.benibix.com/term/infrastructure/kubectl
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
