Why ‘kubernetes’ service ?
Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
Analysis:
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.
Conclusion:
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.