Discovery Service Configuration#

Goal: Deploy the Auto Discovery Service so clients can find and connect to all services through a single JSON endpoint instead of hardcoding each service URL.

The Auto Discovery Service watches the Kubernetes Service objects in your namespace, asks each opted-in service which APIs it implements, and publishes the result as one catalog. You do not list services in the Discovery configuration. Instead, each service opts in with an annotation, and Discovery builds the catalog from what is running.

Note

If you removed earlier deployments, recreate them so you can build on the previous steps.

How Discovery Finds Services#

Every 30 seconds, and whenever a Service changes, Discovery:

  1. Lists the Service objects in the namespace it watches and keeps those annotated discovery.omniverse.nvidia.com/enabled: "true". Services without the annotation are ignored.

  2. Calls the CapabilitiesService.ListServices gRPC method on each of those services to learn which REST and gRPC APIs and versions it implements.

  3. Builds the endpoint URLs. Internal URLs use cluster DNS. External URLs come from the service’s HTTPProxy (see Ingress Configuration) or from the external endpoint annotations.

For Discovery to reach a service, the Kubernetes Service must expose:

  • a gRPC port named grpc, or the port number in the discovery.omniverse.nvidia.com/grpc-port annotation;

  • a REST port named http or rest, if the service has a REST API.

The Storage Service chart names its ports grpc and rest, so setting service.annotations is enough.

Service Ports#

Port

Protocol

Description

8080

HTTP/REST

Internal catalog: services with cluster DNS URLs (/api/v2beta/services)

8081

HTTP/REST

External catalog: services with their externally reachable URLs (/api/v2beta/services)

GET /api/v2/services is an alias for /api/v2beta/services and returns the same response.

These endpoints belong to the deployment’s Discovery Service. The Storage Service also exposes /v2alpha/services on its REST endpoint to describe the API groups implemented by that Storage Service instance. Use the Discovery Service endpoint to locate services across the deployment; use the Storage Service endpoint to inspect that adapter’s capabilities.

Pulling the Discovery Service Helm Chart#

Pull and unpack the Auto Discovery Service Helm chart from the NGC catalog. Use the NGC_API_KEY Bash variable set in Requirements.

# pull the chart from NGC
helm fetch https://helm.ngc.nvidia.com/nvidia/omniverse/charts/auto-discovery-service-1.2.0.tgz --username='$oauthtoken' --password="${NGC_API_KEY:?Set NGC_API_KEY in this Bash session}"

# unpack the chart and cd into the directory
tar -xvf auto-discovery-service-1.2.0.tgz
cd auto-discovery-service

Create the Discovery Service values file#

Use discovery-values.yaml as the values file.

# create and edit the local values file, we're using VS Code for this example
code discovery-values.yaml

The chart’s default image-pull secret is regcred. Replace it with the secret you created for NGC so the Discovery Service can pull its image.

image:
  pullSecrets:
    - name: ngcpull-secret

By default Discovery watches only the namespace it is installed into. To watch several namespaces, set config.kubeNamespace to a comma-separated string or a YAML list. If an annotated Service has the same name in more than one listed namespace, only the first-listed namespace’s Service is published.

config:
  kubeNamespace: "storage-apis"

The chart creates a ClusterRole that lets Discovery list and watch Service and Contour HTTPProxy objects. Set rbac.create: false only when your service account already has those permissions.

discovery-values.yaml

Discovery Schema#

The Discovery Service responds with a JSON object describing each service. Current schema (version 2):

 1{
 2  "schema-version": 2,
 3  "services": [
 4    {
 5      "name": "storage-service",
 6      "version": "1.2.3",
 7      "capability_source": "grpc",
 8      "rest": {
 9        "url": "http://storage-service.storage-apis.svc.cluster.local:8012",
10        "endpoints": [
11          {
12            "name": "fileobject",
13            "versions": {
14              "v1": { "path": "/api/v1/fileobject" }
15            }
16          }
17        ]
18      },
19      "grpc": {
20        "url": "http://storage-service.storage-apis.svc.cluster.local:8011",
21        "endpoints": [
22          { "service": "nvidia.omniverse.storage.fileobject.v1.FileObjectService" }
23        ]
24      }
25    }
26  ]
27}

Schema fields (used by Kit-based apps to discover services):

  • name: The Kubernetes Service name.

  • version: The service version, read from the Service’s app.kubernetes.io/version label. Optional; omitted when the label is absent.

  • rest: Optional. The REST url and the endpoints the service implements, each with the versions it serves and their path.

  • grpc: Optional. The gRPC url and the fully qualified service names it implements.

Clients should read schema-version and expect 2.

Register Services with Discovery#

Add the discovery annotation to each service’s Helm values. For the Storage Service:

# storage-values.yaml
service:
  annotations:
    discovery.omniverse.nvidia.com/enabled: "true"

Redeploy the service for the annotation to take effect. The Event Aggregation and Event Consumer charts take the same service.annotations value.

Other annotations control how a service is published:

Annotation

Purpose

discovery.omniverse.nvidia.com/grpc-port

gRPC port, when the Service has no port named grpc

discovery.omniverse.nvidia.com/visibility

internal, external or both (default both)

discovery.omniverse.nvidia.com/external-rest-endpoint

External REST URL, used instead of the one derived from the HTTPProxy

discovery.omniverse.nvidia.com/external-grpc-endpoint

External gRPC URL, used instead of the one derived from the HTTPProxy

The external catalog on port 8081 lists a service only when it has an external endpoint annotation or a matching HTTPProxy route, so it stays empty until you complete Ingress Configuration.

Install the Discovery Service#

# validate the chart
helm template . -f discovery-values.yaml

# dry-run the install
helm upgrade --install auto-discovery-service . -f discovery-values.yaml --namespace storage-apis --dry-run --debug

If everything looks good, you can install the Discovery Service.

# install the discovery service
helm upgrade --install auto-discovery-service . -f discovery-values.yaml --namespace storage-apis

# validate the pod is running, this may take a few minutes to start up
kubectl get pods -n storage-apis

Where to run: Use an environment that can resolve Kubernetes service DNS and reach the cluster network.

Check Discovery:

curl --fail --silent --show-error \
  http://auto-discovery-service.storage-apis.svc.cluster.local:8080/api/v2beta/services

Expected result: Discovery returns a JSON response with "schema-version": 2 and one entry for each annotated service that is running. Review the returned endpoints against your deployment.

If the response lists no services, check that each service carries the discovery.omniverse.nvidia.com/enabled: "true" annotation, that it exposes the ports described above, and that Discovery watches the service’s namespace. If the hostname cannot be resolved, check where you are running the command before changing the service configuration.

Optional: uninstall Discovery#

Run this step only when removing Discovery. Keep it installed when continuing with the remaining deployment steps.

# uninstall the discovery service
helm uninstall auto-discovery-service -n storage-apis

For removal of all services, see Remove the Complete Deployment.

What’s Next?#

Next: Deploy the Notifications Services to add more functionality, or use a Kit-based application to validate your end-to-end workflow.