GETTING EDGY
Getting Edgy: What is Kubectl?
kubectl is the main way in which you will interact with your Kubernetes cluster

Kubectl is a command line tool used to run commands against Kubernetes clusters. It does this by authenticating with the Master Node of your cluster and making API calls to do a variety of management actions. If you’re just getting started with Kubernetes, prepare to be spending a lot of time with kubectl!
How to Use kubectl
The format of a kubectl command looks like this:
kubectl[command][type][name][flags]
- [command]: specifies the action you want to perform like create, delete, get, apply
- [type]: any Kubernetes resource, whether automatically provided by Kubernetes (like a service or a pod) or created by you with a Custom Resource Definition
- [name]: the name you have given the resource — if you omit the name, kubectl will return every resource specified by the type
- [flags]: specify any additional global or command specific options such as the output format
An example of a command using the full command format is
kubectl get pods hello-world -o yaml
which will make a call to the kubernetes api and output the configuration of a pod named hello-world in yaml format.
Since the name is optional, some commands you will commonly execute will completely omit it such as
kubectl apply -f hello-world.yaml
which will apply a configuration defined in the hello-world.yaml file.
Learn More
- https://kubernetes.io/docs/reference/kubectl/overview/
- https://kubernetes.io/docs/reference/kubectl/cheatsheet/
- https://kubectl.docs.kubernetes.io
Other useful tools: