Skip to content

request help: Health Check not working in APISIX with standalone setup for load balacer functionality . #2542

@taherbohri

Description

@taherbohri

Issue description

Setup -

### ApisixRoute -

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: load-balancer-apisix-route
spec:
  ingressClassName: apisix
  http:
    - name: manageapi
      match:
        paths:
          - /hawkeye-management-service/apis/digital-bff
      upstreams:
      - name: service-v1-upstream
      - name: service-v2-upstream
      plugins:
        - name: proxy-rewrite
          enable: true
          config:
            headers:
              Authorization: "Basic ****"


### Upstreams -

apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
  name: service-v2-upstream
spec:
  scheme: https
  retries: 0
  passHost: node
  externalNodes:
  - type: Domain
    name: api-gateway.example.com
    weight: 1
    port: 443
  healthCheck:
    active:
      type: https
      httpPath: /v1/sadc/gn/healthcheck/status
      host: api-gateway.example.com
      port: 443
      healthy:
        httpCodes:
          - 200
          - 201
          - 202
        interval: "1s"      
        successes: 1    
      unhealthy:
        httpCodes:
          - 500
          - 503
          - 502
        interval: "1s"        
        httpFailures: 1
        tcpFailures: 1
        timeouts: 1
    passive:
      healthy:
        httpCodes:
          - 200
          - 201
          - 202
        successes: 1
      unhealthy:
        httpCodes:
          - 500
          - 503
          - 502
        httpFailures: 1
        tcpFailures: 1
        timeouts: 1



apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
  name: service-v1-upstream
spec:
  scheme: https
  retries: 1
  passHost: node
  externalNodes:
    - type: Domain
      name: external-api-service.example.com
      weight: 1
      port: 443
  healthCheck:
    active:
      type: https
      httpPath: /hawkeye-management-service/health
      host: external-api-service.example.com
      port: 443
      healthy:
        httpCodes:
          - 200
          - 201
          - 202
        interval: "1s"       
        successes: 1      
      unhealthy:
        httpCodes:
          - 500
          - 503
          - 502
        interval: "1s"       
        httpFailures: 1
        tcpFailures: 1
        timeouts: 1
    passive:
      healthy:
        httpCodes:
          - 200
          - 201
          - 202
        successes: 1
      unhealthy:
        httpCodes:
          - 500
          - 503
          - 502
        httpFailures: 1
        tcpFailures: 1
        timeouts: 1

Even after setting up the heathcheck , where one of the health check call will return 503 , the calls are still routing between the 2 upstreams , even when of the upstream is down and heathcheck returns 503.

After checking the apisix docs for healthcheck I got this -

Image

That the health check is deprecated for the standalone deployment .

Is there any solution for this ?

Environment

Environment

  • APISIX version: 3.13.0
  • APISIX Ingress Controller: 2.0.0-rc2
  • Deployment mode: Standalone (apisix-standalone provider)
  • Gateway API: v1
  • Platform: Kubernetes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions