Skip to content

feat(k8s): Support new Gateway api - #875

Draft
contre95 wants to merge 4 commits into
tinyauthapp:mainfrom
contre95:feat/k8s_gateways
Draft

feat(k8s): Support new Gateway api#875
contre95 wants to merge 4 commits into
tinyauthapp:mainfrom
contre95:feat/k8s_gateways

Conversation

@contre95

Copy link
Copy Markdown
Contributor

I'm adding support to the Kubernetes Service reader to read labels not only from 'Ingress' class but also GRPCRoute and HTTPRoute from the new Gateway API.

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a8d5d4f-0318-4c94-b449-5bd6179a0316

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.45562% with 55 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/service/kubernetes_service.go 67.27% 49 Missing and 5 partials ⚠️
internal/service/docker_service.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@steveiliop56

Copy link
Copy Markdown
Member

@contre95 is there any chance we could rebase this to main? I did make some significant changes in the way the Kubernetes service works.

@contre95

Copy link
Copy Markdown
Contributor Author

@contre95 is there any chance we could rebase this to main? I did make some significant changes in the way the Kubernetes service works.

Yes, I saw the changes, the docs on k8s are great. Unfortunately I was not able to work on this one for a while, been very busy at work. I'll try to rebase and work on it this weekend if possible.

contre95 and others added 2 commits August 19, 2026 12:03
Reapply the Gateway API support on top of the KubernetesService rework
from main, which moved the service to ding-managed watchers and a
Lookup based LabelProvider, and started requiring an app to match a host
the resource actually routes.

Ingresses declare their hosts in spec.rules[].host while HTTPRoutes and
GRPCRoutes use spec.hostnames, so host extraction is now dispatched per
resource kind. Route hostnames may carry the Gateway API wildcard label,
which is matched as a suffix, and routes without hostnames are skipped
since the hosts of the gateway listeners they attach to cannot be
resolved from the route alone.

The cache key gains the resource kind because an Ingress and an
HTTPRoute may share a name within a namespace, and the catch-all path
warning is extended to HTTPRoute path matches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The app name fallback matches any domain that starts with the app name,
so an app named myapp served on myapp.example.com also defined the ACLs
of myapp.evil.com. Behind a proxy with a catch-all route, a request can
be authorized against the wrong app that way.

Label providers now receive the domain being authorized. The Kubernetes
provider keeps the hosts of every Ingress, HTTPRoute and GRPCRoute it
watches and withholds the apps of the resources that do not route the
domain, which bounds the name fallback to the hosts a resource actually
serves. Wildcard hostnames keep matching as a suffix, so nested
subdomains stay resolvable by app name.

Container labels carry no routing information, so the Docker provider
cannot narrow its results down and keeps yielding every app.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants