Common kubectl Commands
As previously described, kubectl is a CLI tool that is used to communicate with the Kubernetes API server. kubectl has a lot of useful commands for working with Kubernetes. In this section, we're going to walk you through some commonly used kubectl commands and shortcuts that are used to manage Kubernetes objects.
Frequently Used kubectl Commands to Create, Manage, and Delete Kubernetes Objects
There are several simple kubectl commands that you will use almost all the time. In this section, we will take a look at some of the basic kubectl commands:
get <object>
: You can use this command to get the list of the desired types of objects. Usingall
instead of specifying an object type will get the list of all kinds of objects. By default, this will get the list of specified object types in the default namespace. You can use the-n
flag to get objects from a specific namespace; for example,kubectl get pod -n mynamespace
.describe <...