apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

feature request: Add plugin support for ApisixConsumer

Open akalittle opened this issue 2 years ago • 11 comments

Issue description

ApisixConsumer CRD

apiVersion: apisix.apache.org/v2beta3
kind: ApisixConsumer
metadata:
  name: test-consumer
  namespace: apisix-istio
spec:
  authParameter:
    keyAuth:
      value:
        key: j5giofawfk9OtR6pVvYz
    #  plugins: 
    #    - 

Is there a way to bind some plugins to the consumer directly in yaml file ? However, I know it's possible to apply the plugin via dashboard. But It's more convenient to write all configs in yaml file.

Environment

Environment apache/apisix:2.15.0-alpine apache/apisix-ingress-controller:1.4.1 docker.io/bitnami/etcd:3.5.4-debian-11-r14

Kubernetes cluster version: Client Version: v1.24.0 Kustomize Version: v4.5.4 Server Version: v1.21.12-gke.2200

akalittle avatar Aug 04 '22 03:08 akalittle

What plugins do you need consumer to bind?

AlinsRan avatar Aug 04 '22 03:08 AlinsRan

limit-count to limit the request count the consumer

akalittle avatar Aug 04 '22 04:08 akalittle

I've binded the limit-count plugin in my dev cluster via dashboard. But you know if there are lots of consumers.. You need to bind all the plugin by yourself.

akalittle avatar Aug 04 '22 04:08 akalittle

In the APISIX world, Plugins are associated with Routes, not enabled for Consumers.

We need to keep this behavior consistent with APISIX

tao12345666333 avatar Aug 10 '22 18:08 tao12345666333

That is ok. However, applying plugins to the Consumers is ok in the dashboard. Maybe you should also forbid this in the dashboard?

akalittle avatar Aug 11 '22 01:08 akalittle

Thanks for the reminder, sorry I remembered wrong

https://apisix.apache.org/docs/apisix/terminology/consumer/

So I think we can fill this part of the capacity

tao12345666333 avatar Aug 19 '22 19:08 tao12345666333

@akalittle Are you interested in implementing this feature?

It's not complicated and there is some existing code for reference. Feel free to ping me if you have any issues implementing this feature

tao12345666333 avatar Aug 19 '22 19:08 tao12345666333

@tao12345666333 I just saw this. I will try to implement this feature this this weekend.

akalittle avatar Sep 01 '22 05:09 akalittle

I will reopen this issue for tracking and assign it to you

tao12345666333 avatar Sep 01 '22 05:09 tao12345666333

Are you still working on it? @akalittle

tao12345666333 avatar Dec 01 '22 07:12 tao12345666333

We also want to use this functionality. Is there any progress on implementing this functionality?

nightguide avatar Nov 22 '23 13:11 nightguide