# Controller manager In this section we will configure controller-manager. ![image](./img/08_cluster_architecture_controller_manager.png "Kubelet") >Controller Manager is a core component responsible for managing various controllers that regulate the desired state of the cluster. It runs as a separate process on the Kubernetes control plane and includes several built-in controllers To see controller manager in action, we will create deployment before controller manager configured. ```bash { cat < deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: deployment spec: replicas: 1 selector: matchLabels: app: hello-world-deployment template: metadata: labels: app: hello-world-deployment spec: serviceAccountName: hello-world containers: - name: hello-world-container image: busybox command: ['sh', '-c', 'while true; do echo "Hello, World from deployment!"; sleep 1; done'] EOF kubectl apply -f deployment.yaml } ``` Check created deployment status: ```bash kubectl get deploy ``` Output: ``` NAME READY UP-TO-DATE AVAILABLE AGE nginx-deployment 0/1 0 0 24s ``` As we can se our deployment isn't in ready state. As we already mentioned, in kubernetes controller manager is responsible to ensure that desired state of the cluster equals to the actual state. In our case it means that deployment controller should create replicaset and replicaset controller should create pod which will be assigned to nodes by scheduler. But as controller manager is not configured - nothing happen with created deployment. So, lets configure controller manager. ## certificates We will start with certificates. As you remeber we configured our API server cto use client certificate to authenticate user. So, lets create proper certificate for the controller manager ```bash { cat > kube-controller-manager-csr.json < ... ``` As you can see our controller manager is up and running. So we can continue with our deployment. ```bash kubectl get deploy ``` Output: ``` NAME READY UP-TO-DATE AVAILABLE AGE deployment 1/1 1 1 2m8s ``` As you can see our deployment is up anr running, all desired pods are also in running state ```bash kubectl get pods ``` Output: ``` NAME READY STATUS RESTARTS AGE deployment-74fc7cdd68-89rqw 1/1 Running 0 67s ``` Now, when our controller manager configured, lets clean up our workspace. ```bash kubectl delete -f deployment.yaml ``` Check if pod created by deployment deleted ```bash kubectl get pod ``` Outpput: ``` No resources found in default namespace. ``` Next: [Kube-proxy](./09-kubeproxy.md)