<p>I am creating a K8s object creation workflow, and I want to be sure everything is correct. There is <a href="https://blog.heptio.com/core-kubernetes-jazz-improv-over-orchestration-a7903ea92ca" rel="nofollow noreferrer">this</a> nice flow in Heptio blogs, but controller manager is missing, which is where my doubts are.</p>
<p>If we read K8s docs, <code>Controller Manager</code> is always described as this loop that watches on the desired state of the cluster, and moves all the necessary strings to bring the current state into that (desired) state.</p>
<p>Fair enough, but we also know that kubelet has the container runtime, so kubelet creates containers or pods. We also know that kube-proxy makes the necessary changes in the iptable rules, so services will work properly. And so on. So how does exactly controller manager works?</p>
<p>To my knowledge, there are these processes (Informers/Watchers for each resource; not necessarily 1:1) that watch on resource changes through the API-Server, and add jobs to a Queue, that are consumed by the Worker node components. Would appreciate if anyone could correct me, if I'm wrong.</p>

suren
<p>I think you are right about how the controller manager works. To my best knowledge, controller manager in Kubernetes is a set of controllers such as node controller, pod controller and Deployment controller. Each controller list/watch specific resource and defines some callback functions like update, add and delete. When resource changes the controller call corresponding functions to bring the system to the desired state. You can even define your own CRD and corresponding controller to manage your resource, which is a very strong and flexible tool. The <a href="https://github.com/kubernetes/sample-controller" rel="nofollow noreferrer">sample controller</a> might be useful.</p>
