jcmoraisjr / haproxy-ingress

HAProxy Ingress
https://haproxy-ingress.github.io
Apache License 2.0
1.05k stars 269 forks source link

retry-on configuration #1151

Closed saggiyogesh closed 2 months ago

saggiyogesh commented 4 months ago

What are you trying to do

Trying to use retry-on option with ingress

retry-on is available with haproxy as per below doc link https://www.haproxy.com/documentation/haproxy-configuration-manual/latest/#retry-on

Any way to configure it with ingresses.

jcmoraisjr commented 4 months ago

This seems to be the type of config that can be added via a config snippet, doc here. HAProxy has tons of config options, and we choose to add as our config keys just the ones harder to be configured otherwise.

saggiyogesh commented 4 months ago

@jcmoraisjr is this correct way to configure

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    haproxy-ingress.github.io/balance-algorithm: roundrobin
    haproxy-ingress.github.io/maxconn-server: "500"
    haproxy-ingress.github.io/ssl-redirect: "false"
    haproxy-ingress.github.io/config-backend: |
      retry-on 503 502
      retries 3
jcmoraisjr commented 4 months ago

It seems correct to my understanding, since they both can configured in the backend.

saggiyogesh commented 4 months ago
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    haproxy-ingress.github.io/config-backend: |
      retry-on 503
      retries 100
      timeout connect 30
  creationTimestamp: '2024-07-03T11:56:37Z'
  generation: 5
  name: nginx
  namespace: default
  resourceVersion: '126319'
  uid: 786e57fd-f12b-4236-ac37-0390c11b8043
spec:
  ingressClassName: haproxy
  rules:
    - host: nginx.a-b.deploy.in
      http:
        paths:
          - backend:
              service:
                name: nginx-service
                port:
                  number: 80
            pathType: ImplementationSpecific

@jcmoraisjr The above config seems not to be working, as there's no delay in response to the client in case of a 503 error. Any way to debug this ?

pmint93 commented 3 months ago

@saggiyogesh I would suggest you first exec into the container to check if the /etc/haproxy/haproxy.cfg was generated correctly

github-actions[bot] commented 2 months ago

This issue got stale and will be closed in 7 days.