checkin247 opened a new issue, #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421

   ### Issue description
   
   Hi,
   
   I have found 
[examples](https://apisix.apache.org/docs/ingress-controller/tutorials/proxy-the-httpbin-service-with-ingress/)
 which use the 'annotation' or the 'spec' part of the kubernetes manifest to 
define the ingress controller class.
   
   Using v. 1.5.0
   respectively: apache/apisix-ingress-controller:1.5.0
   
   It seems to work with the 'spec' definition:
   
   ````yaml
   apiVersion: networking.k8s.io/v1
   kind: Ingress
   metadata:
     name: httpserver-ingress
   spec:
     # apisix-ingress-controller is only interested in Ingress
     # resources with the matched ingressClass name, in our case,
     # it's apisix.
     ingressClassName: apisix
     rules:
     - host: local.httpbin.org
       http:
         paths:
         - backend:
             service:
               name: httpbin
               port:
                 number: 80
           path: /
           pathType: Prefix
   ````
   
   however, I was woundering why the 'annotation' definition won't work
   
   
   ````yaml
   apiVersion: networking.k8s.io/v1beta1
   kind: Ingress
   metadata:
     name: httpserver-ingress
     # Note for ingress.networking.k8s.io/v1beta1,
     # you have to carry annotation kubernetes.io/ingress.class,
     # and its value must be matched with the one configured in
     # apisix-ingress-controller, in our case, it's apisix.
     annotations:
       kubernetes.io/ingress.class: apisix
   spec:
     rules:
       - host: local.httpbin.org
         http:
           paths:
             - backend:
                 serviceName: httpbin
                 servicePort: 80
               path: /
               pathType: Prefix
   ````
   
   I also noticed that after the apisix ingress controller was defined once 
with the 'spec' definition, removing it and add it to the 'annotation' keeps 
the route accessable.
   
   So I was wondering wether this is intentional or what the desired behaviour 
should be?
   Respectively why is the ingress class annotation not supported in the 
version "networking.k8s.io/v1"?
   
   ### Environment
   
   - version 1.5.0
   - kubernetes cluster version 1.23.12


-- 
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