apache / apisix-ingress-controller

APISIX Ingress Controller for Kubernetes
https://apisix.apache.org/
Apache License 2.0
1k stars 341 forks source link

request help: how to set plugin priorities #2191

Open rhysxevans opened 6 months ago

rhysxevans commented 6 months ago

Description

Hi, as a user I would like to use the ApisixRoute api to set the plugin priorities as per https://docs.api7.ai/apisix/reference/plugin-common-configurations#_metapriority , this should probably include via the ApisixPluginConfig api

Any help is appreciated

kayx23 commented 3 months ago

Can you try something like this:

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: httpbin-route
spec:
  http:
    - name: httpbin-route
      match:
        paths:
          - /ip
      backends:
        - serviceName: httpbin
          servicePort: 80
      plugins:
      - name: limit-count
        enable: true
        config:
          _meta:
            priority: 1200. # this
          time_window: 10
          count: 2
          rejected_code: 429

and check in the apisx pod if the _meta.proprity is updated? You can port forward 9180 and curl "http://127.0.0.1:9180/apisix/admin/routes" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'.

github-actions[bot] commented 2 weeks ago

This issue has been marked as stale due to 90 days of inactivity. It will be closed in 30 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.