Skip to content

Conversation

@mvachhar
Copy link
Contributor

@mvachhar mvachhar commented Nov 20, 2025

This is the first step to getting rid of the gateway agent and having dataplane talk directly to k8s. This should greatly simplify the code, eliminate the gRPC conversion and eliminate the entire gateway-proto repository.

This commit adds the k8s-direct crate with build
inrastructure that uses kopium to generate the Rust types for the CRD for the gateway-agent that is in the gateway repository.

The next steps will use the CRD to fetch and parse data from k8s, and then translate it into the inner config format of the dataplane.

Fixes #1054

@mvachhar mvachhar self-assigned this Nov 20, 2025
@mvachhar mvachhar requested a review from a team as a code owner November 20, 2025 02:47
@mvachhar mvachhar added the enhancement New feature or request label Nov 20, 2025
@mvachhar mvachhar requested review from sergeymatov and removed request for a team November 20, 2025 02:47
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch 4 times, most recently from 9ffda18 to 1fb7102 Compare November 20, 2025 03:11
@mvachhar mvachhar requested review from Frostman, Copilot and qmonnet and removed request for sergeymatov November 20, 2025 03:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces the k8s-direct crate to enable the dataplane to communicate directly with Kubernetes, eliminating the need for the gateway agent and the gateway-proto repository. The key changes include:

  • Adding build infrastructure that uses kopium to generate Rust types from the gateway-agent CRD
  • Setting up automated CRD fetching and code generation during the build process
  • Creating the foundation for future direct Kubernetes integration

Reviewed Changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/k8s-crd.env Defines the gateway reference and CRD URL for fetching the gateway-agent CRD definition
k8s-direct/src/lib.rs Main library file exposing the generated gateway-agent CRD types
k8s-direct/build.rs Build script that fetches the CRD and generates Rust types using kopium
k8s-direct/Cargo.toml Package configuration with dependencies for Kubernetes interaction and code generation
k8s-direct/.gitignore Excludes the kopium binary installation directory from version control
Cargo.toml Workspace configuration updates adding the k8s-direct crate and required dependencies

@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch from 1fb7102 to a456785 Compare November 20, 2025 03:16
@mvachhar mvachhar requested a review from Copilot November 20, 2025 03:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 9 changed files in this pull request and generated 1 comment.

@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch from a456785 to 566e7ef Compare November 20, 2025 03:37
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We miss a step in CI workflow to make sure that there's no git diff on the generated file after rebuilding the project, or we risk missing updates.

Actually, I think we should commit the source file for generating gateway_agent_crd.rs, rather than the generated file. It means more churn when we update the file (although we could automate bump PR creation), but would feel safer and more deterministic - we'd be sure to use the source in the repo, not something that might diverge in time.

@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch 3 times, most recently from 8a13a73 to 7f5846b Compare November 20, 2025 16:13
@@ -0,0 +1,2 @@
K8S_GATEWAY_AGENT_REF=master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a bad idea to use master as you'll get random rebuilds and dirty repo just by running the build if gateway CRD will change in the background. You can use latest tag v0.28.0 instead and we can later add auto-bump job to the gateway repo, but I'm okay if you want to keep that behavior

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually no, I'm not okay with that as it may cause dirty state in CI, which e.g. will cause tagged releases to be published with -dirty suffix in the version

Copy link
Contributor Author

@mvachhar mvachhar Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll use a sha or tag here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mvachhar mvachhar changed the title feat(k8s-direct): Generate Rust types for gateway-agent CRD feat(k8s-intf): Generate Rust types for gateway-agent CRD Nov 20, 2025
Copy link
Member

@Frostman Frostman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about using master for getting CRD

daniel-noland added a commit to githedgehog/dpdk-sys that referenced this pull request Nov 20, 2025
This is in support of githedgehog/dataplane#1058

Signed-off-by: Daniel Noland <daniel@githedgehog.com>
daniel-noland added a commit to githedgehog/dpdk-sys that referenced this pull request Nov 21, 2025
This is in support of githedgehog/dataplane#1058

Signed-off-by: Daniel Noland <daniel@githedgehog.com>
mvachhar pushed a commit to githedgehog/dpdk-sys that referenced this pull request Nov 21, 2025
This is in support of githedgehog/dataplane#1058

Signed-off-by: Daniel Noland <daniel@githedgehog.com>
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch from 7f5846b to da240ba Compare November 21, 2025 21:37
@mvachhar mvachhar added the dont-merge Do not merge this Pull Request label Nov 21, 2025
@mvachhar mvachhar requested a review from Frostman November 21, 2025 23:38
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch from da240ba to ce34f27 Compare November 22, 2025 01:22
@mvachhar mvachhar removed the dont-merge Do not merge this Pull Request label Nov 22, 2025
@mvachhar mvachhar enabled auto-merge November 22, 2025 01:23
@mvachhar mvachhar requested a review from qmonnet November 22, 2025 03:22
Copy link
Member

@Frostman Frostman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit on the package name, but overall looks reasonable

@mvachhar
Copy link
Contributor Author

Small nit on the package name, but overall looks reasonable

Will rename

@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch from ce34f27 to af2bdf8 Compare November 22, 2025 13:51
@mvachhar mvachhar requested a review from Frostman November 22, 2025 13:52
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're also still missing a CI step to check that there's no diff for the generated file after re-building the package.

@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch 2 times, most recently from 439bde0 to b4d362a Compare November 24, 2025 23:02
rustls uses webpki which has the CDLA-Permissive-2.0 license.
Allow this license so we can add build.rs code to fetch
the gateway-agent CRD in a future release.

Signed-off-by: Manish Vachharajani <manish@githedgehog.com>
This is the first step to getting rid of the gateway agent
and having dataplane talk directly to k8s.  This should
greatly simplify the code, eliminate the gRPC conversion
and eliminate the entire gateway-proto repository.

This commit adds the k8s-intf crate with build
infrastructure that uses kopium to generate the Rust types
for the CRD for the gateway-agent that is in the gateway
repository.

The next steps will use the CRD to fetch and parse data
from k8s, and then translate it into the inner config
format of the dataplane.

Signed-off-by: Manish Vachharajani <manish@githedgehog.com>
Build should not generate any diffs or untracked files.

Signed-off-by: Manish Vachharajani <manish@githedgehog.com>
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct branch from b4d362a to a9e4a84 Compare November 24, 2025 23:02
@mvachhar
Copy link
Contributor Author

We're also still missing a CI step to check that there's no diff for the generated file after re-building the package.

Done.

@mvachhar mvachhar requested a review from qmonnet November 24, 2025 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read gateway agent api CRDs directly into Rust

4 participants