openservicemesh / osm

Open Service Mesh (OSM) is a lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.
https://openservicemesh.io/
Apache License 2.0
2.59k stars 277 forks source link

Allow all headless services, not just those backed by Statefulsets with subdomains #5250

Closed keithmattix closed 1 year ago

keithmattix commented 1 year ago

The existing logic requires hostname to be set before a MeshService is created from a headless service's endpoint. However, hostname is only populated on the endpoint when that endpoint is generated from a StatefulSet. ~This PR creates a MeshService for every service so that it's still resolvable via DNS (instead of kube-proxy like ClusterIP services).~

Creating a MeshService for every headless service creates an issue if there is indeed a subdomain statefulset behind the headless service. Therefore, we only created a separate MeshService if the headless service it came from doesn't have a hostName in at least one of its endpoints