kubectl is the Kubernetes CLI, and it will be our main interface with Kubernetes for most of the time. It is the tool we use to send information to our cluster (for example, a change in our desired state) and to get information from it (for example, which applications are running?).
There are two main ways to use kubectl:
Declarative way
Imperative way
We use it declaratively when we create a manifest that defines what we want and just send that to our cluster that will then find a way to make that happen.
We use it imperatively when we give our cluster specific orders telling it how to do what we want.
The imperative usage of kubectl is fine for development or to quickly test things out. But, the recommended way to use Kubernetes is declaratively, and that’s what we are going to do throughout this course. You will see that things are a lot simpler when we can just tell it what we want and not have to worry about how that will get done.
Summing up
There are multiple subcomponents running in the master and worker nodes, but unless we are operating the cluster ourselves, we can ignore these components for most of the time and treat it as a black box.
If you are curious, this is a more detailed (though still not 100% complete) view of the components running in the master and worker nodes.
Architecture of master and worker nodes
But as we said, most of the time we just need to know that we run kubectl locally, and that will send information to the master node, which will make things happen in the worker nodes