Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haproxy controller mis-sets backends weight to 0 using Gateway resulting in 503 error #1182

Open
rdavyd opened this issue Nov 13, 2024 · 0 comments

Comments

@rdavyd
Copy link

rdavyd commented Nov 13, 2024

Description of the problem

I'm testing argo-rollouts 1.7.2 with argoproj-labs/gatewayAPI 0.3.0 version plugin. Installed v1.0.0 Gateway API via
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml
Updated haproxy to 0.15.0 alpha3 to make use of v1.0.0 Gateway API standard.

Rollout manifest exempt:

  strategy:
    canary:
      canaryMetadata:
        annotations:
          role: canary
        labels:
          role: canary
      stableMetadata:
        annotations:
          role: stable
        labels:
          role: stable
      canaryService: testapp-canary
      stableService: testapp
      steps:
      - setWeight: 20
      - setWeight: 40
      - pause: {}
      trafficRouting:
        plugins:
          argoproj-labs/gatewayAPI:
            httpRoute: testapp
            namespace: myns

HTTProute and Gateway are configured like this:

---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: testapp
  namespace: myns
spec:
  gatewayClassName: haproxy
  listeners:
  - name: http-listener
    port: 80
    protocol: HTTP

---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: testapp
  namespace: myns
spec:
  hostnames:
  - testapp.mycluster.dev
  parentRefs:
  - group: gateway.networking.k8s.io
    kind: Gateway
    name: testapp
  rules:
  - backendRefs:
    - group: ""
      kind: Service
      name: testapp
      port: 8080
      weight: 100
    - group: ""
      kind: Service
      name: testapp-canary
      port: 8080
      weight: 0

Both testapp and testapp-canary Services refer to the same PODs when deployment is stable and argo-rollouts controller sets weight to 0 for the canary service when rollout successfully completes.
When this happens haproxy-controller sets weight of backends to 0:

    server srv001 10.10.180.29:8080 weight 0 check inter 2s
    server srv002 10.10.180.90:8080 weight 0 check inter 2s
    server srv003 10.10.180.91:8080 weight 0 check inter 2s
    server srv004 10.10.180.92:8080 weight 0 check inter 2s
    server srv005 10.10.180.93:8080 weight 0 check inter 2s

This results in returning 503 error when curling testapp.mycluster.dev
If I manually edit HTTPRoute and set canary services weight to any non-zero setting everything starts working.

Expected behavior

Haproxy controller shouldn't set backend weight to zero when the one of multiple services in the HTTPRoute has 0 weight set.

Steps to reproduce the problem

  • Create Deployment and two Services with different names both referring to the same Deployment PODs
  • Create Gateway and HTTPRoute as pointed out above
  • Curling the Hostname from HTTPRoute produces 503 error
  • Manually set second Service weight to non-zero value
  • Curling the Hostname from HTTPRoute produces expected result

Environment information

HAProxy Ingress version: v0.15.0 alpha3
argo-rollouts 1.7.2 with argoproj-labs/gatewayAPI version 0.3.0
Gateway API v1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant