<p>While learning kubernetes, terms like kubectl, master node, api server etc come up regularly. Kubectl is client to interact with k8s cluster for doing stuff like creating pods, managing them etc. For eg, locally I use it to work with minikube.</p>
<p>But kubectl is more like manual interaction for running commands. In production environment pods are supposed to be spawn automatically as need arises. So how does that happen? Or is my understanding wrong about kubectl?</p>

Mandroid
<p>For <strong>Production</strong> also you can use the <strong>Kubectl</strong> or <strong>Helm</strong> or kustomize to apply the YAML</p>
<p>ideally, in production you should be at the end applying the YAML to deploy the application.</p>
<p>You can choose the helm or kustomize to create or generate YAML as a specific application. once your YAML is ready you can apply the YAML using <strong>kubectl</strong>.</p>
<pre><code>kubectl apply -f file-name.yaml
</code></pre>
<p>Or you can helm chart to deploy the relase of application.</p>
<pre><code>helm install &lt;chart-name&gt;
</code></pre>
<p>Helm read more : <a href="https://helm.sh/docs/topics/charts/" rel="nofollow noreferrer">https://helm.sh/docs/topics/charts/</a></p>
<p><strong>Kustomize</strong> is K8s native config management Read more here: <a href="https://kustomize.io/" rel="nofollow noreferrer">https://kustomize.io/</a></p>
<p>Ultimately you will be creating the YAML like below for app and applying using <strong>Kubectl</strong> either dev, stag or prod doesn't matter</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
</code></pre>
<p>Deploying using the <strong>kubectl</strong> cli without YAML is also fine but not much flexibility there.</p>
<p>While by looking at <strong>YAML</strong> you can get an idea of what is deployed and configuration.</p>
