Service Discovery

The Lighthouse project provides DNS discovery for Kubernetes clusters connected by Submariner in multi-cluster environments.

Architecture

The below diagram shows the basic Lighthouse architecture.

Lighthouse Architecture

Lighthouse Agent

The Lighthouse Agent runs in every cluster and accesses the Kubernetes API server running in the broker cluster to exchange service metadata information with other clusters. Local service information is exported to the broker and service information from other clusters is imported.

Workflow

The workflow is as follows:

  • Lighthouse agent connects to the broker’s K8s API server.
  • For every Service in the local cluster for which a ServiceExport has been created, the agent creates a corresponding ServiceImport resource and exports it to the broker to be consumed by other clusters.
  • For every ServiceImport resource in the broker exported from another cluster, it creates a copy of it in the local cluster.

Lighthouse Agent WorkFlow

Lighthouse DNS Server

The Lighthouse DNS server runs as an external DNS server which owns the domain supercluster.local. KubeDNS is configured to forward any request sent to supercluster.local to the Lighthouse DNS server, which uses the ServiceImport resources that are distributed by the controller for DNS resolution.

Workflow

The workflow is as follows.

  • A Pod tries to resolve a Service name using the domain name supercluster.local
  • KubeDNS forwards the request to the Lighthouse DNS server.
  • The Lighthouse DNS server will use its ServiceImport cache to try to resolve the request.
  • If a record exists it will be returned, else an NXDomain error will be returned.

Lighthouse CoreDNS WorkFlow