It should be possible to apply plugins per host


#1

Since a new KongPlugin resource is created for each host on the Ingress, it would be more intuitive if the plugins could be applied per host instead of the ingress level.

For example, 1 plugin, 1 ingress with 2 hosts

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: my-request-transformer
config:
  remove:
querystring: []
headers: ['x-myheader']
body: []
  add:
querystring: []
headers: ['x-myheader:myheadervalue']
body: []
plugin: request-transformer

---

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
spec:
  rules:
- host: "localhost1"
  http:
    paths:
      - path: /
        backend:
          serviceName: myservice
          servicePort: 80
- host: "localhost2"
  http:
    paths:
      - path: /
        backend:
          serviceName: myservice
          servicePort: 80

this results in 2 kong services each with their own plugin instance. I would like to be able to apply different plugins per each service.


#2

Hello @eamonnmcevoy,

You can accomplish this by splitting up your Ingress resource into two separate resources and then reference different KongPlugin resources on them using the plugins.konghq.com annotation.