Skip to content

Generate HTTPRoute sectionName to select listener #610

Closed as not planned
Closed as not planned
@acelinkio

Description

@acelinkio

Please provide a method to setup routes created via Knative to configure route parentref listener section. Gateways allow for restricting access to listeners. This is especially useful when wanting to ensure that no traffic is sent in plain text.

Example where the listener on 80 is limited to HTTPRoute that is a 301 redirect:

apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: internal
  namespace: cilium-gateway
spec:
  gatewayClassName: cilium
  listeners:
  - protocol: HTTP
    port: 80
    name: http
    allowedRoutes:
      namespaces:
        from: Same
  - protocol: HTTPS
    port: 443
    name: https
    tls:
      certificateRefs:
      - kind: Secret
        name: wildcard-production
        namespace: cilium-secrets
    allowedRoutes:
      namespaces:
        from: All
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: httpsredirect-internalgw
  namespace: cilium-gateway
spec:
  parentRefs:
    - name: internal
      namespace: cilium-gateway
      sectionName: http
  rules:
    - filters:
        - requestRedirect:
            scheme: https
            statusCode: 301
          type: RequestRedirect
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: grafana
  namespace: monitoring
spec:
  parentRefs:
  - name: internal
    namespace: cilium-gateway
    sectionName: https
  hostnames:
  - "grafana.mydomain.tld"
  rules:
  - backendRefs:
    - name: grafana
      port: 80

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions