emissary-ingress / emissary

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy
https://www.getambassador.io
Apache License 2.0
4.32k stars 683 forks source link

upstream request timeout with ingress v1 when specifying backend.service.port.name #4322

Open m-yosefpor opened 2 years ago

m-yosefpor commented 2 years ago

Describe the bug

When specifiying backend.service.port.name instead of backend.service.port.number, emissary ingress will not function:

HTTP/1.1 504 Gateway Timeout
content-length: 24
content-type: text/plain
date: Fri, 08 Jul 2022 01:45:49 GMT
server: envoy

upstream request timeout

To Reproduce Steps to reproduce the behavior:

  1. create a simple pod/service/ingress.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test
spec:
  ingressClassName: ambassador
  rules:
  - host: test.example.com
    http:
      paths:
      - backend:
          service:
            name: my-service
            port:
              number: 8080 <<<<<< here
        path: /
        pathType: Prefix

This will work fine. Now change the port.number and use port.name in the service instead. emissary ingress will no longer work for that ingress.

Expected behavior

Service backends should work with either port.number or port.name.

Versions (please complete the following information):

Additional context

As k8s v1.23+ has deprecated and dropped support of ingress v1beta, supporting ingress v1 spec is essential.

cindymullins-dw commented 2 years ago

Was this working before and stopped working on 3.0? I'm not sure if named ports are currently supported.

m-yosefpor commented 2 years ago

no I don't think so. we switched our ingress controller to emissary, and this kind of ingresses stopped working.

cindymullins-dw commented 1 year ago

Got it. I don't believed named ports work currently so this would be a feature request. Are you able to help contribute a PR for this perhaps?

antonu17 commented 1 year ago

Hi all! I faced the same behavior and proposing a fix (or feature) #4809