<p>I understand that <code>kubectl</code> is some kind of interface with a K8s cluster but I don't fully understand what's going on.<br />
I see that tutorials mention various commands e.g.</p>
<pre><code>kubectl get nodes
kubectl decribe pod 
</code></pre>
<p>etc</p>
<p>but I don't really understand with which nodes in the cluster does <code>kubectl</code> interact.<br />
First of all in a production system is there only one k8s cluster or multiple?<br />
How does kubectl know which cluster or which node to execute the commands we pass? Or does it do it for all cluster/nodes?</p>

Jim
<p>You have multiple questions in one here.</p>
<ul>
<li>How does it know which cluster to interact with? That's the kubeconfig and context. <code>cat ~/.kube/config</code> — you should see at least one <code>context</code>, and a <code>current-context</code>.</li>
<li>How many clusters might you have in prod? Depends on your system, I've had systems with 1, 2, and 3, but there could be many more (think about cross-region availability, separate clusters for compliance, isolation of internal applications, etc).</li>
<li>How does it interact with clusters at all? The API, kubectl is essentially a nice CLI that hits kube-apiserver, which is exposed by the control plane to allow access to the cluster and its resources.</li>
</ul>
<p>I highly recommend skimming <a href="https://kubernetes.io/docs/reference/glossary/" rel="nofollow noreferrer">the glossary</a> and reading about <a href="https://kubernetes.io/docs/concepts/overview/components/" rel="nofollow noreferrer">the components</a>, and spending some additional time with the docs in general, to get a feel for how all the pieces interact.</p>
