Application-gateway-kubernetes-ingress: Please Add Support for networking.k8s.io/v1

Created on 1 Feb 2021  路  3Comments  路  Source: Azure/application-gateway-kubernetes-ingress

Ingress and IngressClass types in the聽extensions/v1beta1聽and聽networking.k8s.io/v1beta1聽API versions are deprecated and will no longer be served in 1.22+. Persisted objects can be accessed via the聽networking.k8s.io/v1聽API.

Above is from the k8s change log, please can support be added to this library as we do not want to upgrade to k8s 1.19.* until this lib can support these changes that have come in.

Thanks

Alex

Most helpful comment

Indeed @rlevchenko i believe the missing attribute for AGIC to properly interpret this new spec is the proper handling of the path depending on pathType. AGIC will not properly interpret the pathType attribute of the ingress definition as per networking.k8s.io api and one would need to always provide the path as it should appear in the AppGW routing rule. In order to comply with the new specification

 rules:
    - host: hostname
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: service-api
                port:
                  number: 443

Should register /api/* as the path in the routing rule and

 rules:
    - host: hostname
      http:
        paths:
          - path: /api
            pathType: Exact
            backend:
              service:
                name: service-api
                port:
                  number: 443

should register /path

All 3 comments

Ingress annotation kubernetes.io/ingress.class should now be considered formally deprecated and we need support for IngressClass resource and ingressClassName, pathType Ingress resource specs added in Kubernetes 1.18 as the following example:

IngressClass

apiVersion: networking.k8s.io/v1beta1
kind: IngressClass
metadata:
  name: azure-application-gateway
spec:
  controller: azure/application-gateway

Ingress

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name:  my-ingress
  annotations:
    appgw.ingress.kubernetes.io/backend-path-prefix: "/"
spec:
  ingressClassName: azure-application-gateway
  tls:
   - hosts:
     - bar.foo.com
     secretName: tls-secret
  rules:
  - host: bar.foo.com
    http:
      paths:
      - path: /api
        pathType: Prefix
        backend:
          serviceName: bar-foo-service
          servicePort: 80

@mateustanaka you are right. AGIC 1.4.0 can't work without deprecated annotation (based on my testing), however, AGIC works fine with networking.k8s.io/v1 Ingress api : service.port.name , service.port.number and other new fields.

...
 rules:
    - host: hostname
      http:
        paths:
          - path: /api/*
            pathType: Prefix
            backend:
              service:
                name: service-api
                port:
                  number: 443
...

Indeed @rlevchenko i believe the missing attribute for AGIC to properly interpret this new spec is the proper handling of the path depending on pathType. AGIC will not properly interpret the pathType attribute of the ingress definition as per networking.k8s.io api and one would need to always provide the path as it should appear in the AppGW routing rule. In order to comply with the new specification

 rules:
    - host: hostname
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: service-api
                port:
                  number: 443

Should register /api/* as the path in the routing rule and

 rules:
    - host: hostname
      http:
        paths:
          - path: /api
            pathType: Exact
            backend:
              service:
                name: service-api
                port:
                  number: 443

should register /path

Was this page helpful?
0 / 5 - 0 ratings