A control loop continually compares a resource’s declared desired state with its current state, then takes corrective action to reconcile differences. Kubernetes uses control loops to keep resources in the state specified by users. section 3.2.2 section 3.2.4
Kubernetes control loops operate through several responsibilities:
- The controller manager runs separate logical controllers in one binary and continually checks the resources each controller manages. section 3.2.2
- A ReplicaSet loop compares the available Pod count with the declared replica count, adding or deleting Pods as necessary. section 3.2.4
- The cloud controller manager applies the same pattern to provider-specific resources such as nodes, routes, load balancers, network filtering, and IP addresses. section 3.2.2
- Scheduling remains a separate responsibility: the scheduler selects a worker node, while unsatisfied resource requests or constraints cause scheduling failure. section 3.2.2
Maintaining three replicas
A deployment declares three Pod replicas. If one Pod is accidentally deleted, the control loop detects that only two are available and creates a replacement, restoring the declared count. section 3.2.4
Table 3.1 Bundled controllers and their roles (view table figure)
| Maintains the mapping of pods to services, creating endpoints for services |
|
| Creates the initial default account and API tokens for namespaces |
Use the controller-role table to connect reconciliation responsibilities with node status, Pod replication, service endpoints, and service accounts. section 3.2.2
