Today, i installed an Ingress (Nginx) and i asked myself : “How Kubernetes know that this deployment/DaemonSet is for an ingress resource, and not just a simple web app ?”.
I don’t understand how kubernetes deals with that, because i just created some srvices accounts, and then I lauched a daemonSet. I didn’t inform explicitly Kubernetes to use that nginx as Ingress, but he knows How it works ?
My understanding of Ingress inner working is as follows;
When we deploy an ingress ‘controller’ - here its Nginx ingress controller - the controller will be watching K8S API for ‘Ingress’ objects. The moment it sees an Ingress object that is been applied using a yaml ; the ingress controller will grab that object attributes and make modification on its configuration. When we hit the Ingress service IP , the controller will route that traffic based on the attributes that we applied using the yaml.
So, when we install an Ingress Controller (Nginx, Traefik, … ) through deployments/DaemonSet, they contact the API server and self-register to the list of available Ingress controllers. Then, they watch for Kubernetes Ingress Resource in ETCD (Normal Controller role).