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

*: Integrate the kgateway chart into the repository #10485

Merged
merged 15 commits into from
Jan 24, 2025

Conversation

timflannagan
Copy link
Member

Description

This commit is a follow-up to #10470 and integrates the newly bootstrapped kgateway helm chart into the repository and replacing the legacy chart in CI. While this is a foundational step, further iterations and chart design adjustments will follow to refine and fully replace the legacy chart. The goal is to gradually transition to the new chart while deprecating the legacy implementation.

Additional changes include publishing this helm chart along with the #10441 stream of work. This can be done as an extension of the release GHA workflow once we pass the initial hurdle with integrated this chart with CI and getting green runs.

Related to #10484 which renamed the default container image registry from quay to ghcr.io. The new helm chart will have this as the default registry going forward.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@timflannagan
Copy link
Member Author

Publishing this branch after some offline conversation with a couple of people. This branch is highly WIP but it's failing conformance and folks with more context could help triage.

@timflannagan timflannagan force-pushed the helm/integrate-kgateway-chart branch 7 times, most recently from 2832a75 to de864ab Compare January 22, 2025 22:42
Copy link
Contributor

@yuval-k yuval-k left a comment

Choose a reason for hiding this comment

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

left some comments, over all looks good!

install/helm/kgateway/templates/deployment.yaml Outdated Show resolved Hide resolved
install/helm/kgateway/templates/deployment.yaml Outdated Show resolved Hide resolved
install/helm/kgateway/templates/deployment.yaml Outdated Show resolved Hide resolved
install/helm/kgateway/templates/deployment.yaml Outdated Show resolved Hide resolved
install/helm/kgateway/templates/role.yaml Show resolved Hide resolved
install/helm/kgateway/values.yaml Outdated Show resolved Hide resolved
@@ -3,7 +3,7 @@ apiVersion: gateway.networking.k8s.io/v1
metadata:
name: example-gateway
spec:
gatewayClassName: gloo-gateway
gatewayClassName: kgateway
Copy link
Contributor

Choose a reason for hiding this comment

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

i agree we need to perform this change but will also need to think about downstream effects. cc @lgadban

Copy link
Contributor

Choose a reason for hiding this comment

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

let's track gatewayClass discussion in this repo

Copy link
Contributor

Choose a reason for hiding this comment

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

stubbed out #10503

projects/gateway2/install.sh Outdated Show resolved Hide resolved
projects/envoyinit/cmd/Dockerfile.envoyinit Outdated Show resolved Hide resolved
install/helm/kgateway/values.yaml Outdated Show resolved Hide resolved
@timflannagan timflannagan force-pushed the helm/integrate-kgateway-chart branch from de864ab to 8e245da Compare January 23, 2025 17:32
@timflannagan timflannagan changed the title WIP: Integrate the kgateway chart into the repository *: Integrate the kgateway chart into the repository Jan 23, 2025
@timflannagan
Copy link
Member Author

Sorry for the force push. I was looking into chunking the WIP commit into several commits to cherry-pick into their own PRs if necessary.

version: 0.1.0
version: "v0.0.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

Just a temporary version here, but we can figure out the right value in a follow-up or do it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed for now. We can add helm tests once the new chart is hooked into the release workflow.

namespace: "kgateway-system"

# Gateway proxy configuration
gateway:
Copy link
Member Author

Choose a reason for hiding this comment

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

I held off on changing any of the gateway param related helm chart values and c/p from the legacy chart as the deployer unit tests validate the AI extension and SDS containers components and I didn't want to change too much all at once.

Copy link
Contributor

Choose a reason for hiding this comment

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

we can leave for now so it's not a massive PR but i think we need to revisit soon; if these are the values consumed by the default GatewayParams i would want to move them closer to the gatewayClass itself.
happy to discuss more here but seems like a good follow-up

Copy link
Member Author

Choose a reason for hiding this comment

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

Totally agree. I was going to handle re-designing this as a follow-up during this stream of release work. I just wanted to get a chart integrated with CI so publishing this chart is unblocked in the release workflow.

Comment on lines -4 to +5
GlooDeploymentName = "gloo"
GlooServiceName = "gloo"
GlooDeploymentName = "kgateway"
GlooServiceName = "kgateway"
Copy link
Member Author

Choose a reason for hiding this comment

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

Mentioned in the commit message, but this was needed to ensure the right xds_cluster socket address got populated in managed proxies.

@@ -35,8 +34,8 @@ go run k8s.io/code-generator/cmd/register-gen --output-file zz_generated.registe
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:maxDescLen=0 object rbac:roleName=k8sgw-controller paths="${APIS_PKG}/api/${VERSION}" \
output:crd:artifacts:config=${SCRIPT_ROOT}/../../install/helm/gloo/crds/ output:rbac:artifacts:config=${SCRIPT_ROOT}/../../install/helm/gloo/files/rbac

go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:maxDescLen=0 object rbac:roleName=k8sgw-controller paths="${APIS_PKG}/api/${VERSION}" \
Copy link
Member Author

Choose a reason for hiding this comment

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

A follow-up will rip out the legacy chart's RBAC generation.

install/helm/gloo/files/rbac/role.yaml Outdated Show resolved Hide resolved
install/helm/kgateway/templates/deployment.yaml Outdated Show resolved Hide resolved
namespace: "kgateway-system"

# Gateway proxy configuration
gateway:
Copy link
Contributor

Choose a reason for hiding this comment

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

we can leave for now so it's not a massive PR but i think we need to revisit soon; if these are the values consumed by the default GatewayParams i would want to move them closer to the gatewayClass itself.
happy to discuss more here but seems like a good follow-up

install/helm/kgateway/templates/deployment.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have an equivalent to this anywhere else?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not at the moment, but this is a gap imo with how we're installing kgateway in CI anyways (i.e. there's no single make target that handles all of this). Ex, the conformance suite first calls setup-kind.sh, then helm installs the locally packaged chart, then runs the make conformance target. I'll tackle this as a follow-up -- there's a couple of open questions w.r.t. VERSION default that I'd like to discuss more.

This commit adds several kubebuilder RBAC markers for the corev1,
appsv1, GW API, etc. resources that are needed by the slimmed down
stack. Previously, we were generating RBAC for kgateway-specific
APIs (e.g. DirectResponse, GatewayParameters, etc.).

Signed-off-by: timflannagan <[email protected]>
The kgateway chart was initially bootstrapped via helm create
in a previous main branch PR. This chart is not functional and
contains some cruft that helm generates that isn't relevant to
this project (e.g. ingress). This commit deletes several files,
re-structures the values.yaml and templates/ directories.

Previous commits generated the required RBAC files. This expands
on that motion and introduces the GatewayClass and default
GatewayParameter CR templates.

Signed-off-by: timflannagan <[email protected]>
This script will be no longer relevant once the repository
overhaul is complete and Makefile targets have been introduced
to replicate any install paths.

Signed-off-by: timflannagan <[email protected]>
This removes the Settings CR from the setup.yaml bootstrap
configuration in the envtests. The kgateway chart does not
carry this CR over to it's crds/ directory or have the RBAC
permissions to watch, list, etc. the resource.

Previously, we removed the legacy Settings logic in the gateway2
control plane in kgateway-dev#10458, so this resource is no longer necessary
in the setup.yaml and envtest fails trying to deploy it with the
new chart.

Signed-off-by: timflannagan <[email protected]>
This updates the constant variables in the kubeutils package to
use the "kgateway" container name. Without this, the conformance
suite will fail as the xds_cluster socket address is pointing to
a kube svc DNS name that does not exist (e.g. gloo.kgateway-system.svc).

Signed-off-by: timflannagan <[email protected]>
@timflannagan timflannagan force-pushed the helm/integrate-kgateway-chart branch from 881b237 to 0bf312e Compare January 24, 2025 16:04
@timflannagan
Copy link
Member Author

(Accidentally ran rebase --onto on the wrong branch lol).

Copy link
Contributor

@lgadban lgadban left a comment

Choose a reason for hiding this comment

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

LGTM!

@lgadban lgadban added this pull request to the merge queue Jan 24, 2025
Merged via the queue into kgateway-dev:main with commit 00af1d6 Jan 24, 2025
6 checks passed
@timflannagan timflannagan deleted the helm/integrate-kgateway-chart branch January 24, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants