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

make glooctl check work for kube gateways #9621

Merged
merged 50 commits into from
Jun 21, 2024
Merged

Conversation

jenshu
Copy link
Contributor

@jenshu jenshu commented Jun 14, 2024

Description

Check Kubernetes Gateway API resources during glooctl check, as long as we detect that the kube gateway integration is enabled in the given gloo installation. We assume kube gateway integration is enabled if 1) we find Gateway CRDs on the cluster and 2) a default GatewayParameters exists in the install namesapce.

Other cleanup:

Output :

Checking Deployments... OK
Checking Pods... OK
Checking Upstreams... OK
Checking UpstreamGroups... OK
Checking AuthConfigs... OK
Checking RateLimitConfigs... OK
Checking VirtualHostOptions... OK
Checking RouteOptions... OK
Checking Secrets... OK
Checking VirtualServices... OK
Checking Gateways... OK
Checking Proxies... OK

Detected Kubernetes Gateway integration!
Checking kube GatewayClasses... OK
Checking kube Gateways... OK
Checking kube HTTPRoutes... OK

Skipping Gloo Instance check -- Gloo Federation not detected.
No problems detected.
Checking Deployments... OK
Checking Pods... OK
Checking Upstreams... OK
Checking UpstreamGroups... OK
Checking AuthConfigs... OK
Checking RateLimitConfigs... OK
Checking VirtualHostOptions... OK
Checking RouteOptions... OK
Checking Secrets... OK
Checking VirtualServices... OK
Checking Gateways... OK
Checking Proxies... OK

Skipping Gloo Instance check -- Gloo Federation not detected.
Error: 1 error occurred:
	* unable to determine if kube gateway is enabled: KubeGateway is enabled but the Kubernetes Gateway CRDs are not applied. Please fix this by running `kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml`

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

@solo-changelog-bot
Copy link

Issues linked to changelog:
https://github.com/solo-io/solo-projects/issues/5741

@github-actions github-actions bot added the keep pr updated signals bulldozer to keep pr up to date with base branch label Jun 14, 2024
@jenshu jenshu marked this pull request as ready for review June 14, 2024 15:19
@jenshu jenshu requested a review from a team as a code owner June 14, 2024 15:19
Copy link

github-actions bot commented Jun 14, 2024

Visit the preview URL for this PR (updated for commit 3d97e2a):

https://gloo-edge--pr9621-glooctl-check-kube-3zxd8mrg.web.app

(expires Fri, 28 Jun 2024 19:57:50 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 77c2b86e287749579b7ff9cadb81e099042ef677

@davidjumani
Copy link
Contributor

I have a similar approach and would like feedback on it :

  • First, check the presence of the GatewayParameters CR.
  • If found, check the presence of the k8s gateway CRDs.
  • If they are not found, error loudly that they are not found and the installation is misconfigured as the GatewayParameters CR is present but the k8s gateway CRDs are not.
  • Else proceed with the k8s gateway-related checks

Additionally I think that relying on the presence of the GatewayParameters CR wouldn't be the best way to go about this as users can delete the default CRs and replace them with their own.
Instead, we can label the gloo deployment and check for the presence of that label or the presence of the GG_EXPERIMENTAL_K8S_GW_CONTROLLER env variable something more concrete. I understand that this is tying up the check with the implementation but it seems more robust

Copy link
Contributor

@sam-heilbron sam-heilbron left a comment

Choose a reason for hiding this comment

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

@davidjumani
Copy link
Contributor

kick bulldozer

@soloio-bulldozer soloio-bulldozer bot merged commit 326f4c9 into main Jun 21, 2024
20 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the glooctl-check-kube branch June 21, 2024 21:21
davidjumani added a commit that referenced this pull request Jun 21, 2024
* glooctl check

* cl

* codegen

* use const

* standardize casing

* standardize case

* update kubegateway check

* fix import

* scheme

* KUBE2E_TESTS not needed by setup-kind

* fix test

* Adding changelog file to new location

* Deleting changelog file from old location

* fix typo

* add additional check outputs

* exclude kube checks

* add docs to exclude

* ensure kube resources are not checked if not enabled

* add exclude options

* add todo

* update kubegatewayenabled check

* fix newline

* use constants

* return early

* update comment

* Update error

* address comments

* rename kube gateway

* update message

---------

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: changelog-bot <changelog-bot>
Co-authored-by: David Jumani <[email protected]>
@davidjumani
Copy link
Contributor

We have some new CRDs:

* https://github.com/solo-io/gloo/blob/main/install/helm/gloo/crds/gateway.solo.io_v1_HttpListenerOption.yaml

* https://github.com/solo-io/gloo/blob/main/install/helm/gloo/crds/gateway.solo.io_v1_ListenerOption.yaml
  They don't report statuses, but I think it would make sense to check them still

Will tackle in a followup PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep pr updated signals bulldozer to keep pr up to date with base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants