You should not try to reinvent the wheel, unless there are some specific features in these products that you want but didn't disclose in your original answer.
Kubernetes and Service Fabric, both provides a simple and useful feature for service discovery, called DNS Service.
Whenever new services are created, they are registered in the DNS with their addresses, when an application running on the cluster tries to resolve a DNS for a particular service domain name, it query the DNS and get the IP of the service without you requiring to type any additional logic other than the out of the box provided by most languages.
Service Fabric, also provides two other features for service discovery if for example you need to resolve stateful services and need get a specific partition:
- Reverse Proxy: Provides an URL for accessing services without knowing their location, the service will connecto to the proxy that will resolve the service address for you.
- Service-to-Service Communication via Service Remoting: Via code you can resolve the service location using the ServiceProxy.
Kubernetes on the other hand, does not provide baked features the same way, because it is more flexible to chose your own solution, in this case, there are plenty of solutions out there. One I can guide you to is Istio