kubernetes-sigs / aws-load-balancer-controller

A Kubernetes controller for Elastic Load Balancers
https://kubernetes-sigs.github.io/aws-load-balancer-controller/
Apache License 2.0
3.93k stars 1.46k forks source link

Paths of type "Prefix" do not work as expected #1702

Closed Nuru closed 3 years ago

Nuru commented 3 years ago

According to the Kubernetes documentation, a pathType of Prefix and value / should match all paths, but with aws-load-balancer-controller v2.0.1 it only matches /

[EDIT: Support for pathType of Prefix was added in version 2.2.0]

My ingress:

kind: Ingress
apiVersion: networking.k8s.io/v1beta1
metadata:
  name: echo-server
  namespace: echo
  annotations:
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80},{"HTTPS":443}]'
    alb.ingress.kubernetes.io/scheme: internet-facing
spec:
  tls:
    - hosts:
        - echo.example.com
  rules:
    - host: echo.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              serviceName: echo-server
              servicePort: http

gives me 404 Not Found errors for all paths except exactly /:

HTTP/2 404 
server: awselb/2.0

It should behave exactly the same way as the implementation dependent /*.

Having type Prefix work as expected is very important for portability.

M00nF1sh commented 3 years ago

@Nuru We only support ImplementationSpecific currently. Prefix PathType is planned. /kind feature

kishorj commented 3 years ago

PR #1772

kishorj commented 3 years ago

Feature supported in v2.2.0 release

youzipi commented 1 year ago

Feature supported in v2.2.0 release

@kishorj is there any way to achieve the prefix rule in before version? we use v1.1.5 ☹️

youzipi commented 1 year ago

Feature supported in v2.2.0 release

@kishorj is there any way to achieve the prefix rule in before version? we use v1.1.5 ☹️

is these two configuration can achieve the same effect? if so, why we need the prefix config? it provide better performance with limited scenario?

      - path: /actuator*
        pathType: ImplementationSpecific

      - path: /actuator
        pathType: Prefix
lbaschiera-tdh commented 1 year ago

Why isn't there any explicit mention in the controller documentation about how ImplementationSpecific works for it? Based on Kubernetes documentation, it depends on each controller, so why not explicitly mention it somewhere?