Repository navigation
feat(global-router): add the Global Discovery HTTP service #17371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 54 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
9e368cf
feat(global-router): add a crate for types the Global Router componen…
atchernych 008d8f2
refactor(global-router): drop doc comments that restate their items
atchernych 71f89c9
fix(global-router): check a registration's model and correct three do…
atchernych 8e30f3c
fix(global-router): let a client follow any lease the service grants
atchernych 8b6c23e
feat(global-router): name a pool's PoolRelay by every address of its pod
atchernych c7ee161
test(global-router): drop checks the JSON round trips already make
atchernych 48637b7
feat(global-router): add the pool discovery contract and its stores
atchernych 03eae14
fix(global-router): mark a stale MCS view incomplete and log empty ones
atchernych 36125d9
docs(global-router): say that an MCS watch stream waits for its first…
atchernych c410173
perf(global-router): read EndpointSlice lists from the API server's c…
atchernych 959e2d5
perf(global-router): list EndpointSlices unpaged, so the cache serves…
atchernych a962b76
docs(global-router): say that pool Services need a ServiceExport, not…
atchernych 1a1372a
fix(global-router): address the standards review of the discovery stores
atchernych ce637fc
fix(global-router): address the second review of the discovery stores
atchernych 130aaef
fix(global-router): address the third review of the discovery stores
atchernych 0d55a3c
feat(http-server): copy the reusable HTTP server core from #17178
atchernych 8ae83b1
feat(global-router): add the Global Discovery HTTP service
atchernych 4a70569
feat(global-router): add a container image and manifest for the Globa…
atchernych a38eb3d
fix(global-router): accept hyphenated pool suffixes and state the man…
atchernych d0dc8fb
fix(global-router): bound the lease the Global Discovery Service grants
atchernych f8d3d54
refactor(global-router): pass registrations and listings straight thr…
atchernych 6db71b3
fix(global-router): bound how long the Kubernetes client waits
atchernych c6efecb
Merge branch 'main' into atchernych/global-common
atchernych 4bb3f61
Merge branch 'atchernych/global-common' into atchernych/global-discov…
atchernych 5d30317
Merge branch 'atchernych/global-discovery-service' into atchernych/gl…
atchernych 7919ee9
Merge branch 'main' into atchernych/global-common
atchernych 4323f2a
refactor(global-router): rename the shared types as reviewers asked
atchernych 5aadafa
refactor(global-router): build the discovery client on the shared types
atchernych 0a33716
Merge branch 'atchernych/global-common' into atchernych/global-discov…
atchernych 69d703e
refactor(global-router): follow the shared types' renames
atchernych 8428c92
Merge branch 'atchernych/global-discovery-service' into atchernych/gl…
atchernych e3f8acd
refactor(global-router): follow the shared types' renames
atchernych 547d554
Merge branch 'main' into atchernych/global-discovery-service
atchernych 2a80836
docs(global-router): document the stores' watch streams, as the bots …
atchernych 459c03f
fix(global-router): use Karmada's real Service name limit, 55
atchernych c09f797
Merge branch 'atchernych/global-discovery-service' into atchernych/gl…
atchernych f5c0508
docs(global-router): word the Karmada name check for any exported Ser…
atchernych 044d6b5
Merge branch 'atchernych/global-discovery-service' into atchernych/gl…
atchernych fb5ba6c
refactor(global-router): split --store into --pool-discovery and --re…
atchernych d829bc7
refactor(global-router): tighten the new flags after an adversarial r…
atchernych 06b4f63
docs(global-router): call the discovery implementations backends, not…
atchernych 4bd3635
Merge branch 'atchernych/global-discovery-service' into atchernych/gl…
atchernych 952f1ff
ci(global-router): cover the Global Discovery Service image and manifest
atchernych c5760a3
fix(global-router): check the Global Discovery Service flags, and ans…
atchernych 8e0fc02
fix(global-router): run the example manifest under restricted Pod Sec…
atchernych fad5749
fix(global-router): make every flag mistake a usage error, and warn w…
atchernych 822175e
docs(global-router): say what the watch stream waits for
atchernych 260d5e6
feat(global-router): reserve POST /routers until router registration …
atchernych 39a56e0
docs(global-router): say how callers treat a partial list
atchernych bc1eeed
Merge branch 'atchernych/global-discovery-service' into atchernych/gl…
atchernych 0917613
Merge branch 'main' into atchernych/global-discovery-service
atchernych 00bec2a
Merge branch 'atchernych/global-discovery-service' into atchernych/gl…
atchernych 7332626
fix(global-router): list every Ready PoolRelay pod of a pool
atchernych b844440
Merge branch 'atchernych/global-discovery-service' into atchernych/gl…
atchernych 98c2a63
fix(global-router): cap request bodies at 64 KiB
atchernych 88c07e4
Merge branch 'main' into atchernych/global-discovery-http
atchernych 7f61b37
docs(global-router): give the manifest's path from the repository root
atchernych c0264e1
Merge branch 'main' into atchernych/global-discovery-http
atchernych File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # syntax=docker/dockerfile:1.10.0 | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # CPU-only image for the Global Discovery Service, which serves pool discovery | ||
| # for the Global Router over HTTP; see global-discovery-service.yaml. Build it | ||
| # from the repository root: | ||
| # docker build -f container/Dockerfile.global-discovery-service -t global-discovery-service . | ||
| FROM rust:1.96.1-trixie AS builder | ||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
| build-essential cmake pkg-config protobuf-compiler libclang-dev libssl-dev curl \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| WORKDIR /workspace | ||
| COPY . . | ||
| RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \ | ||
| --mount=type=cache,target=/usr/local/cargo/git,sharing=locked \ | ||
| cargo build --locked --release -p dynamo-global-discovery-service --bin global-discovery-service | ||
|
|
||
| FROM debian:trixie-slim AS global-discovery-service | ||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
| ca-certificates libstdc++6 \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| COPY --from=builder /workspace/target/release/global-discovery-service /usr/local/bin/global-discovery-service | ||
| USER 10001:0 | ||
| EXPOSE 8080 | ||
| ENTRYPOINT ["/usr/local/bin/global-discovery-service"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Global Discovery Service with pools from Karmada, applied directly to the hub | ||
| # cluster (not through Karmada). Replace IMAGE with the pushed image, for example: | ||
| # sed "s#IMAGE#<registry>/global-discovery-service:<tag>#" global-discovery-service.yaml | kubectl apply -f - | ||
| # It needs only read access to EndpointSlices. It lists the pools whose | ||
| # `<DGD name>-pool-relay` Services Karmada imports, and the replicas of the | ||
| # Global Router Service named by the --router-* arguments: set those to the | ||
| # router's namespace, its Service and the port PoolRelays connect to. | ||
| # | ||
| # It reads the imported slices with the pod's credentials, so this cluster | ||
| # needs a ServiceImport for each pool's PoolRelay Service and for the router | ||
| # Service. To read the Karmada control plane instead, which holds every | ||
| # exported Service's slices, mount its kubeconfig from a Secret, point | ||
| # KUBECONFIG at it, and grant the same read access there. | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: global-discovery | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: global-discovery-service | ||
| namespace: global-discovery | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: global-discovery-service | ||
| rules: | ||
| - apiGroups: ["discovery.k8s.io"] | ||
| resources: ["endpointslices"] | ||
| verbs: ["get", "list", "watch"] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: global-discovery-service | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: global-discovery-service | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: global-discovery-service | ||
| namespace: global-discovery | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: global-discovery-service | ||
| namespace: global-discovery | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: global-discovery-service | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: global-discovery-service | ||
| spec: | ||
| serviceAccountName: global-discovery-service | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| containers: | ||
| - name: global-discovery | ||
| image: IMAGE | ||
| args: | ||
| # Takes IPv4 and IPv6. On nodes with IPv6 turned off, use | ||
| # 0.0.0.0:8080. | ||
| - --listen=[::]:8080 | ||
| - --pool-discovery=karmada | ||
| - --router-namespace=global-discovery | ||
| - --router-service=global-router | ||
| - --router-port-name=http | ||
| env: | ||
| - name: DYN_LOG | ||
| value: info | ||
| ports: | ||
| - name: http | ||
| containerPort: 8080 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /healthz | ||
| port: http | ||
| periodSeconds: 5 | ||
| lifecycle: | ||
| # Keep serving while the Pod leaves the Service's endpoints. | ||
| preStop: | ||
| exec: | ||
| command: ["sleep", "5"] | ||
| resources: | ||
| requests: | ||
| cpu: 50m | ||
| memory: 64Mi | ||
| limits: | ||
| memory: 256Mi | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| drop: ["ALL"] | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: global-discovery-service | ||
| namespace: global-discovery | ||
| spec: | ||
| selector: | ||
| app.kubernetes.io/name: global-discovery-service | ||
| ports: | ||
| - name: http | ||
| port: 8080 | ||
| targetPort: http | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| //! Implementations of [`crate::pool_discovery`], one module per | ||
| //! backend. | ||
|
|
||
| pub mod kubernetes; | ||
| pub mod memory; | ||
| mod stream; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.