Service Discovery
This topic introduces you to service discovery for Kubernetes infrastructure, its significance, and its purpose.
What is a discovered service?
Discovered service is an entity on the Harness platform (also known as the control plane) that corresponds to a Kubernetes service on your (user) cluster. It includes details about the connections made from and to it.
Below is the control flow to a discovered service.
Why is a discovered service required?
Large enterprises deal with hundreds of deployed services. Monitoring these services on these services would require building a database of these services and the relationship between these services, which is time-consuming. Service discovery comes into the picture: Instead of creating a database with the services, automatically discover services and the relationship between them.
How does Harness discover services?
Harness performs the following steps to discover services in your cluster:
- Scan your Kubernetes cluster periodically (you can define the interval or ad-hoc).
- Build a database of services that describes the relationship between the services.
- Provide APIs to group the discovered services into a map, wherein the map represents a topological view of an application.
How does Harness leverage discovered services?
- Identify the various available services in the Kubernetes cluster that you can deploy using Harness or other means.
- Record the resources backing the above services (logical resources such as deployment, pods, containers, processes, FQDNs, ports, physical resources such as nodes, storage, and so on).
- Highlight the given service's position and the lineage within the topology view.
You can leverage all the permissions mentioned for service discovery.
Advantages
- Reduces overhead of creating a database with services
- User-friendly
- Increased adoption of Harness
When you are onboarding, one of the steps involves discovering services. Harness creates the discovery agent that automatically discovers services for your application.