macmiranda commented on issue #343:
URL: 
https://github.com/apache/apisix-helm-chart/issues/343#issuecomment-1335519920

   @tao12345666333
   
   I was looking into this and how other ingress controllers manage 
`IngressClasses` and it seems to me the standard way of doing it (to be able to 
support multiple classes via the same controller, i.e.  the Kubernetes way) is 
for the controller to get/list all `IngressClasses` registered on the cluster 
where `spec.controller` is set to a unique identifier, e.g. 
   ```
   apiVersion: networking.k8s.io/v1
   kind: IngressClass
   metadata:
     name: apisix-custom-1
   spec:
     controller: apisix.apache.org/ingress-controller
   ```
   From that point on, the controller would watch for new `Ingresses` where the 
`ingressClassName` matches the `metadata.name` of the `IngressClass`, in this 
case, `apisix-custom-1`. I believe currently the only supported class is 
`apisix`, which is hard-coded 
[here](https://github.com/apache/apisix-ingress-controller/blob/be7edf6b880e4904553c98f57dd78766632e1520/pkg/config/config.go#L41).
   
   You can see how `traefik` is doing it 
https://github.com/traefik/traefik/blob/56f7515ecd8572c6a4c73f35e54b33414e6efb79/pkg/provider/kubernetes/ingress/client.go#L483-L492
   
   The `spec.controller` value that it searches for 
https://github.com/traefik/traefik/blob/c57876c116ebc375becaff476fbcf6f25c4db7f3/pkg/provider/kubernetes/ingress/kubernetes.go#L35
   
   So I guess this needs a counterpart issue on 
https://github.com/apache/apisix-ingress-controller, only then would it make 
sense to add the `IngressClass` template to this chart.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to