We're expanding our microservice herd application and i was looking into Kubernetes for our needs. Before my dive into the modern orchestration i was thinking about service discovery in the following way:
- Cluster is bootstrapped with some kind of distributed service registry (Consul in our case)
- Every service is launched with service registry endpoints passed in somehow
- Every service self-registers itself in registry
- Whenever service needs some other service addresses, it fetches contact points from registry
In that case, if any service fails or some kind of network disruption occurs, client service may proceed with next contact point and eventually succeed (in case it is not totally cut off). As far as i've understood, kubernetes uses completely different model:
- All pods are self-registered in kubernetes
- Kubernetes provides single load balancer instance to pass traffic through to services
- Load balancer itself may be discovered via environment variables or DNS query (and that may result in creepy things such as fetching port from DNS records or just stale environment variable)
And that confuses me a little. If i'm correct (feel free to tell me i'm not if that's the case), this basically turns load balancer into SPOF that may stop whole application the moment it dies. Am i right? Are there any guarantees made by Kubernetes that such situation won't happen or would be resolved in <N> <time units>?