endpoint: improve k8s stateful set support
Created by: tsenart
This commit improves the k8s stateful set support by not using service endpoints and instead generating a static list from the replica count. This is needed because membership changes of K8S service endpoints during deployments cause a temporary rebalancing mayhem in zoekt.
In the future, we'd want to use this for gitserver too, but that sharding is currently done at the gitserver.Client level, and migrating to this package will cause a full scale rebalancing.
In addition to the functional change, this patch also refactors the package to isolate k8s things from the Map, and decouple service discovery as a separate, but integrated concept with the Map.
Tagging backend devs since this is a core library.