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

Allow multiple Match rules for dashboard ingress route #1212

Open
2 tasks done
morotsgurka opened this issue Oct 9, 2024 · 1 comment
Open
2 tasks done

Allow multiple Match rules for dashboard ingress route #1212

morotsgurka opened this issue Oct 9, 2024 · 1 comment
Labels
kind/breaking This PR introduce a breaking change kind/proposal a proposal that needs to be discussed.

Comments

@morotsgurka
Copy link

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you expect to see?

Hi!

I'm using Authentik Proxy Provider for authentication on a k3s cluster. To define the authentication I need 2 Rules in the routes of the IngressRoute. Here is an example of my ingress for Longhorn's WebUI:

 apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: longhorn-frontend-ingress
  annotations:
    kubernetes.io/ingress.class: traefik-external
spec:
  entryPoints: 
    - websecure
  routes:
    - kind: Rule
      match: Host(`longhorn.domain.com`)
      middlewares:
        - name: authentik
          namespace: networking
      priority: 10
      services:
        - name: longhorn-frontend
          port: 8000
    - kind: Rule
      match: "Host(`longhorn.domain.com`) && PathPrefix(`/outpost.goauthentik.io/`)"
      priority: 15
      services:
        - kind: Service
          name: ak-outpost-traefik-proxy
          port: 9000
  tls:
    secretName: longhorn-prod-tls

From what I've read/understood, the values for the ingressRoute -> Dashboard uses this template file?

It then matches with "matchRule" from the values.yaml?

So my suggestion is having "routes: []" in values.yaml something like this:

ingressRoute:
  dashboard:
     enabled: true
     routes:
        - kind: Rule
          match: PathPrefix(`/dashboard`) || PathPrefix(`/api`)
          # -- The internal service used for the dashboard ingressRoute
          services:
              - name: api@internal
                kind: TraefikService
          # -- Additional ingressRoute middlewares (e.g. for authentication)
          middlewares: []
    # -- Specify the allowed entrypoints to use for the dashboard ingress route, (e.g. traefik, web, websecure).
    # By default, it's using traefik entrypoint, which is not exposed.
    # /!\ Do not expose your dashboard without any protection over the internet /!\
    entryPoints: ["traefik"]
    

And then update the ingressRoute template file to loop through(?) the routes specified.
This would/should keep the default deployment the same but allow users to specify more than one match rule.

I'm no helm-chart expert so excuse me if I've simply misunderstood something about how helm charts/values work

@mloiseleur mloiseleur added kind/enhancement New feature or request kind/breaking This PR introduce a breaking change kind/proposal a proposal that needs to be discussed. and removed status/0-needs-triage kind/enhancement New feature or request labels Oct 10, 2024
@mloiseleur
Copy link
Contributor

You're right, for simplicity, the template is using only 1 route.
If we change this, it would be breaking for everyone.

We’re unsure about the use case and the traction it will receive. We are going to leave the status as kind/proposal to give the community time to let us know if they would like this idea.

We will reevaluate as people respond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/breaking This PR introduce a breaking change kind/proposal a proposal that needs to be discussed.
Projects
None yet
Development

No branches or pull requests

2 participants