jcmoraisjr / haproxy-ingress

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

retry-on configuration #1151

Open saggiyogesh opened 6 days ago

saggiyogesh commented 6 days 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 6 days 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 5 days 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 days ago

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

saggiyogesh commented 4 days 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.dcdeploy.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 ?