You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/11/01 07:18:03 UTC

[GitHub] [apisix-ingress-controller] checkin247 opened a new issue, #1421: request help: ingress class spec vs. annotation

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: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1421: docs: Provides configuration in different Kubernetes versions for the Ingress resource

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421#issuecomment-1298143677

   thanks


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 closed issue #1421: docs: Provides configuration in different Kubernetes versions for the Ingress resource

Posted by GitBox <gi...@apache.org>.
tao12345666333 closed issue #1421: docs: Provides configuration in different Kubernetes versions for the Ingress resource 
URL: https://github.com/apache/apisix-ingress-controller/issues/1421


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] checkin247 commented on issue #1421: request help: ingress class spec vs. annotation

Posted by GitBox <gi...@apache.org>.
checkin247 commented on issue #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421#issuecomment-1298126830

   @tao12345666333 thank you for the immediate resonse.
   Some of the documentations are using the annotation version, example: 
   https://apisix.apache.org/docs/ingress-controller/concepts/annotations/#redirect
   
   I think this should be updated then.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1421: docs: Provides configuration in different Kubernetes versions for the Ingress resource

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421#issuecomment-1298131556

   Are you willing to modify it?


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1421: docs: Provides configuration in different Kubernetes versions for the Ingress resource

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421#issuecomment-1327923373

   e2e will not be modified for the time being, because we need to be compatible with some old versions of the K8s environment.
   
   A feasible solution has not yet been obtained.
   
   
   #1425 has been merged. I will close this one. Thanks!


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1421: request help: ingress class spec vs. annotation

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421#issuecomment-1298124980

   https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation
   
   > Before the IngressClass resource and ingressClassName field were added in Kubernetes 1.18, Ingress classes were specified with a kubernetes.io/ingress.class annotation on the Ingress. This annotation was never formally defined, but was widely supported by Ingress controllers.
   
   > The newer ingressClassName field on Ingresses is a replacement for that annotation, but is not a direct equivalent. While the annotation was generally used to reference the name of the Ingress controller that should implement the Ingress, the field is a reference to an IngressClass resource that contains additional Ingress configuration, including the name of the Ingress controller.
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1421: request help: ingress class spec vs. annotation

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421#issuecomment-1298129676

   Yes.
   
   In fact, we should provide both configurations for users to use in different versions of Kubernetes clusters.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] checkin247 commented on issue #1421: docs: Provides configuration in different Kubernetes versions for the Ingress resource

Posted by GitBox <gi...@apache.org>.
checkin247 commented on issue #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421#issuecomment-1298140047

   sure


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] checkin247 commented on issue #1421: docs: Provides configuration in different Kubernetes versions for the Ingress resource

Posted by GitBox <gi...@apache.org>.
checkin247 commented on issue #1421:
URL: https://github.com/apache/apisix-ingress-controller/issues/1421#issuecomment-1298248209

   @tao12345666333 
   I made the required modifications, you can check the difference here: https://github.com/apache/apisix-ingress-controller/compare/master...checkin247:apisix-ingress-controller:issue-1421
   
   The mdlint is ok.
   
   TBD:
   
   1) Should the manifests for "apiVersion: networking.k8s.io/v1beta1" also be updated?
   Example: docs/en/latest/tutorials/proxy-the-httpbin-service-with-ingress.md:83
   (I guess not)
   
   2) There are E2E tests which make use of the annotation, example:
   test/e2e/suite-ingress/suite-ingress-resource/ingress.go:738
   test/e2e/suite-annotations/authorization.go:45
   I assume modifying tests should be done by someone else.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org