Why ‘kubernetes’ service ?
kubectl describe svc kubernetes
Name: kubernetes Namespace: default Labels: component=apiserver provider=kubernetes Annotations: <none> Selector: <none> Type: ClusterIP IP Family Policy: SingleStack IP Families: IPv4 IP: 10.96.0.1 IPs: 10.96.0.1 Port: https 443/TCP TargetPort: 6443/TCP Endpoints: 172.31.15.134:6443 Session Affinity: None Events: <none>
- ‘kubernetes’ is a clusterIP service. (ie can be accessed only inside the cluster.)
- It has no selector specified.( So no automatic LB.)
- But endpoints specified(maybe hardcoded) as 172.31.15.134:6443 ( that means all the requests to this service will be routed to 172.31.15.134:6443)
- Now you can see the its the IP and port corresponding to APIServer pod.
So kubernetes service act as a service for APIServer Pod.
Other pods inside the cluster like Scheduler, Controller etc, can use this service to communicate with APIServer pod.