THREAD: What happens when you create a Pod in Kubernetes?
Spoiler: a surprisingly simple task reveals a complicated workflow that touches several components in the cluster.
1/8
You are probably familiar with the first 4 steps:
1. kubectl sends the YAML to the API 2. The Pod is stored in etcd 3. The scheduler assigns a Node
At this point the Pod is etcd, but no in the node.
4. The kubelet starts creating the Pod.
2/8
Next:
1. The kubelet delegates creating the container to the CRI 2. The kubelet delegates attaching the container to the network to the CNI 3. The CNI assigns an IP address 4. Probes are checked 5. The kubelet reports the IP address to the control plane
1. Scripts that create update, delete, etc. infrastructure are saved in GIT. 2. The state of your infrastructure is saved in GIT. 3. You have automation to trigger all your scripts.
Let's see an example.
2/10
Let's deploy an app with a single replica:
1. Commit the Deployment definition in GIT 2. Execute the script to deploy 3. Done