Skip to content

Ingress should support frontend and backend via path based routing #255

Open
@raffraffraff

Description

@raffraffraff

Problem: can't expost frontend and backend on different paths

The chart does not appear to support this because it's too prescriptive about what is allowed, ie: the host rule contains one port/path, and an extraHosts rule forces you to add another host which supports one port/path

  rules:
    - host: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.host "context" $ ) }}
      http:
        paths:
          - path: {{ .Values.ingress.path }}
            pathType: Prefix
            backend:
              service:
                name: {{ include "common.names.fullname" . }}
                port:
                  number: {{ .Values.service.ports.backend }}
    {{- range .Values.ingress.extraHosts }}
    - host: {{ .name | quote }}
      http:
        paths:
          - path: {{ default $.Values.ingress.path .path }}
            pathType: {{ default "Prefix" .pathType }}
            backend:
              service:
                name: {{ include "common.names.fullname" $ }}
                port:
                  number: {{ default $.Values.service.ports.backend .port }}

Use case

I'm deploying Backstage with Github OAuth authentication, which requires a callback address (that hits the backend). I don't want two different hosts, I want a single host with path based routing, eg:

  • https://backstage.internal.company.com/frontend
  • https://backstage.internal.company.com/backend

Suggestion

The template should have a more flexible approach to ingress configuration, allowing multiple path/port rules within a single host item. But instead of reinventing the wheel piecemeal, you could use the example from the NGNIX chart, which has support for flexible host/port/path combinations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions