Kubernetes
Describe in detail what happens when you create a service
Difficulty: unrated
Source: bregman-arie/devops-exercises
by Arie Bregman
Answer
- Kubectl sends a request to the API server to create a Service
- The controller detects there is a new Service
- Endpoint objects created with the same name as the service, by the controller
- The controller is using the Service selector to identify the endpoints
- kube-proxy detects there is a new endpoint object + new service and adds iptables rules to capture traffic to the Service port and redirect it to endpoints
- kube-dns detects there is a new Service and adds the container record to the dns server