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

request help: how to translate the nginx weight-based annotation to apisix ingress controller #2199

Open
ruiruijianggg opened this issue Apr 3, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@ruiruijianggg
Copy link

Issue description

I want to know how to translate the weight-based canary annotation in nginx【nginx.ingress.kubernetes.io/canary-weight】. The apisix ingress controller implements the canary function based on the traffix-split plug-in. Now I can only get the weight of the gray upstream from annotation. And the traffic-split plugin-in needs the id and weight of both the baseline upstream and the gray upstream. How the apisix ingress controller implement canary publishing based annotations?

Environment

  • your apisix-ingress-controller version (output of apisix-ingress-controller version --long): 1.8.0
  • your Kubernetes cluster version (output of kubectl version): v1.25.3
  • if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a):
@pottekkat
Copy link
Contributor

@ruiruijianggg From the Nginx Ingress Controller docs it seems like the weight you set in the nginx.ingress.kubernetes.io/canary-weight is the the percentage of traffic you want to route to your canary deployment. In APISIX, the you can configure a more granular traffic split where you can specify the ratio of how traffic is to be split between your baseline deployment and canary deployment. So if you want to directly translate, you can translate the percentage to ratio.

nginx.ingress.kubernetes.io/canary-weight: 50 would mean 50% to canary release. In ApisixRoute, this becomes:

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: canary-release
spec:
  http:
    - name: canary-route
      match:
        paths:
          - /*
      backends:
        - serviceName: baseline-deployment
          servicePort: 8080
          weight: 50
        - serviceName: canary-deployment
          servicePort: 8080
          weight: 50

The weight can also be 1:1 or 2:2 as it would be treated as ratios as opposed to percentages in the Nginx annotation.

@pottekkat pottekkat self-assigned this Apr 3, 2024
@pottekkat pottekkat added the question Further information is requested label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants