Hi everyone,
I am working on a migration from ingress-nginx controller to traefik. I was looking at using the kubernetesingressnginx provider, which is able to translate a lot of annotations I currently use with NGINX.
But there are a few unsupported annotations such as proxy-body-size and canary related annotations so completely using the kubernetesingressnginx provider is a hurdle. What I tried first is creating a middleware object, and referring it in the Ingress YAML, like below..
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
nginx.ingress.kubernetes.io/cors-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
nginx.ingress.kubernetes.io/cors-allow-methods: GET, POST, PUT, DELETE, OPTIONS
nginx.ingress.kubernetes.io/cors-allow-origin: https://example.com,https://test.mytest.net
nginx.ingress.kubernetes.io/cors-max-age: "3600"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/proxy-body-size: 100m
nginx.ingress.kubernetes.io/ssl-redirect: "false"
traefik.ingress.kubernetes.io/router.middlewares: traefik-test-test-app-nginx-class@kubernetescrd,traefik-test-test-app-nginx-class-buffering@kubernetescrd
name: test-app-nginx-class
namespace: traefik-test
However, when using kubernetesingressnginx, it ignores the traefik.ingress.kubernetes.io/router.middlewares annotation, and generate middleware for supported ingress-nginx annotations only.
My expectation was that it would generate middleware for the supported annotations, and merge it wil the CRDs for middleware I created and added as an annotation.
When using kubernetesingress, it only takes into consideration the middleware CRDs (which is expected).
Before I post in GitHub issue for a feature request, is there already a way (which I may have missed in documentation) to link KubernetesCRD Middleware when using kubernetesingressnginx provider? It would make my life much easier! Because otherwise I will have to go with kubernetesingress and re-visit a lot of out platform engineering logic.