Skip to content
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

Add a new gateway reconciler in rust #184

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aryan9600
Copy link
Member

@aryan9600 aryan9600 commented Feb 11, 2024

Introduce a new folder controlplane-rs meant for the new controlplane that's to be written in Rust (#150). Add a new reconciler for Gateway objects that behaves pretty similarly to the reconciler written in Golang (along with a few improvements around conditions and reasons). It reconciles Gateway v1 objects unlike the Go reconciler which works with v1beta1 objects.

TODOs:

  • tests
  • utilities to build and deploy
  • a convenient way to swap out the Golang reconciler for this one

Fixes #176

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 11, 2024
@astoycos astoycos self-assigned this Feb 12, 2024
@astoycos
Copy link
Member

YAYYYY I'll try and get to this during the week!! Thanks @aryan9600!!!!

@shaneutt
Copy link
Member

/cc

@shaneutt shaneutt self-assigned this Feb 20, 2024
@shaneutt
Copy link
Member

@aryan9600 you can rebase to the latest main now for some general CI fixes that just merged.

Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

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

Got an initial start on a review, but didn't get super far yet, I will come back around!

controlplane-rs/.dockerignore Outdated Show resolved Hide resolved
Comment on lines 1 to 2
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx

Copy link
Member

Choose a reason for hiding this comment

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

What is the xx image all about? I'm not sure about this 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

https://github.com/tonistiigi/xx
tldr: it contains helper scripts for common tools like cargo, go, etc. to make building cross platform docker images easy

Copy link
Member

Choose a reason for hiding this comment

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

These kinds of dependencies always make me a bit wary. If you think it adds a lot of value then maybe we can move forward with it, but if its only keeping us from writing say, a couple lines? I would consider removing it from the supply-chain.

Copy link
Contributor

Choose a reason for hiding this comment

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

I second Shane's concern. Looking through the repo, I can see the value-add---setting up cross-platform images can be a pain in the booty.

That said, I'm always inclined to err on the side of keeping your dependency footprint smaller, especially for security purposes.

Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

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

Took another review pass today, but I still haven't gotten entirely through it. Mostly minor things so far, looking good! I will take another pass soon.

controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_controller.rs Outdated Show resolved Hide resolved
Copy link
Member

@astoycos astoycos left a comment

Choose a reason for hiding this comment

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

Yahoooo Let's get this rolling :)

I still have way more to go here but I probably won't be able to get to it until tonight/tomorrow

it's just a reconciler for the gateway object not gatewayclass, tcproute, or udproute at the moment right?

controlplane-rs/src/gateway_utils.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_utils.rs Outdated Show resolved Hide resolved
controlplane-rs/src/gateway_utils.rs Outdated Show resolved Hide resolved
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 21, 2024
@shaneutt
Copy link
Member

@aryan9600 looks like we need some updates on your side here to push on, let us know if you're stuck or blocked or need any support 🖖

@aryan9600
Copy link
Member Author

aryan9600 commented May 23, 2024

@shaneutt @astoycos this is ready for another round of review :)

it's just a reconciler for the gateway object not gatewayclass, tcproute, or udproute at the moment right?

correct

@aryan9600 aryan9600 force-pushed the gateway-controller-rs branch 2 times, most recently from d32cfa5 to 4a7d23f Compare May 23, 2024 14:42
Introduce a new folder `controlplane` meant for the new controlplane
that's to be written in Rust (kubernetes-sigs#176).
Add a new reconciler for Gateway objects that behaves pretty similarly
to the reconciler written in Golang.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
@aryan9600
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 23, 2024
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
@aryan9600 aryan9600 force-pushed the gateway-controller-rs branch 2 times, most recently from 70f8adb to 033bf71 Compare May 30, 2024 11:50
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

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

Thanks @aryan9600 this is great!

While I'm sure we could do several more rounds of review on this, given the sandbox nature of the project and the foundational nature of this work (we have others waiting to contribute to the new Rust control-plane) I'm in favor of defaulting to shipping this for now so we can move quickly into the other parallel iterations that will use this as groundwork.

/approve

@astoycos please lgtm when you're ready

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aryan9600, shaneutt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

Port the Gateway reconciler to Rust
6 participants