haproxytech / kubernetes-ingress

HAProxy Kubernetes Ingress Controller
https://www.haproxy.com/documentation/kubernetes/
Apache License 2.0
712 stars 200 forks source link

ingress anotation timeout-server does not change haproxy config #617

Open dosmanak opened 7 months ago

dosmanak commented 7 months ago

I added annotation haproxy.org/timeout-server: 15m to ingress manifest but generated backend does not contain timeout server directive. annotations:

    haproxy.org/backend-config-snippet: http-request deny if !{ path_beg -f patterns/keycloak-publicly-available-urls
      } !{ src -f patterns/whitelisted-ips }
    haproxy.org/forwarded-for: "true"
    haproxy.org/ssl-redirect: "true"
    haproxy.org/timeout-server: 15m

haproxy.cfg backend

backend keycloak-dev_svc-keycloak_http
  mode http
  balance roundrobin
  option forwardfor
  no option abortonclose
  default-server check
  ###_config-snippet_### BEGIN
  http-request deny if !{ path_beg -f patterns/keycloak-publicly-available-urls } !{ src -f patterns/whitelisted-ips }
  ###_config-snippet_### END
  server SRV_1 10.64.142.228:8080 enabled
  server SRV_2 127.0.0.1:8080 disabled
  server SRV_3 127.0.0.1:8080 disabled
  server SRV_4 127.0.0.1:8080 disabled
  server SRV_5 127.0.0.1:8080 disabled
  server SRV_6 127.0.0.1:8080 disabled
  server SRV_7 127.0.0.1:8080 disabled
  server SRV_8 127.0.0.1:8080 disabled

Version is haproxytech/kubernetes-ingress:1.10.7

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dosmanak commented 6 months ago

I read on Slack I am not the only one who experienced the bug.

ivanmatmati commented 6 months ago

Hi @dosmanak , I'm looking at it, thanks for reporting.

ivanmatmati commented 6 months ago

It seems the documentation for annotation is not aligned with the code on this because of the possibility of using CRD for that. But as the annotation is present at configmap level, we'll add the missing annotations for ingress and service resources. Thanks for reporting.

fabianonunes commented 6 months ago

Hello, @ivanmatmati

I noticed that this bug isn't reproducible on the 1.11 branch. After bisecting, I found out that commit e2f797cdb7efefa44232dfb2c7cb57e1039a1e40 fixes this issue.

Perhaps we should consider backporting it to the 1.10 branch

ivanmatmati commented 6 months ago

Hi @fabianonunes , you're correct and actually I made a mistake because the version that @dosmanak uses does not provide the annotation for service and ingress. As you noticed only 1.11 does. We'll consider to backport it as you suggested.