Kong Plugin Setup within same ingress resource for different paths

Hello Team,
I am looking to configure plugins at each path level within the same Ingress resource. For instance, consider the following YAML configuration:
yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
konghq.com/strip-path: “true”
name: example-ingress
namespace: default
spec:
ingressClassName: kong
rules:

  • http:
    paths:
    • backend:
      service:
      name: echo
      port:
      number: 1027
      path: /echo
      pathType: ImplementationSpecific
    • backend:
      service:
      name: test-svc
      port:
      number: 8085
      path: /book
      pathType: ImplementationSpecific
      In this YAML file, I want to configure different plugins for my two endpoints (/echo and /book). Is there a way to achieve this? Could someone please assist me with this?
      Thank you!

Hi @Shivay_Gupta
As per given Ingress I can see that you have 2 different backend service(echo and test-svc).
In this you can apply plugin at service level like below.

konghq.com/plugins: rate-limiting-plugin

apiVersion: v1
kind: Service
metadata:
  name: echo
  labels:
    app: echo
  annotations:
    konghq.com/plugins: rate-limiting-plugin
spec:
  ports:
  - port: 80
    targetPort: 8080
    protocol: TCP 
  selector:
    app: echo