k8gb-io/k8gb

Support for Ingress @ networking.k8s.io/v1

jkremser opened this issue · 2 comments

Since k8s@1.22 the Ingress with version extensions/v1beta1 nor networking.k8s.io/v1beta1 are no longer supported. The only supported version is now networking.k8s.io/v1

Ingress@v1 was there since 1.19

If k8gb is deployed to a kubernetes cluster with version 1.22 or higher, it keeps crash-looping on this error:

2022-02-16T16:03:02Z ERR github.com/k8gb-io/k8gb/controllers/logging/logr.go:60 > gslb: if kind is a CRD, it should be installed before calling Start {"reconciler group":"k8gb.absa.oss","reconciler kind":"Gslb"} error="no matches for kind \"Ingress\" in version \"networking.k8s.io/v1beta1\""

We use part of the Ingress schema for the gslb schema itself, therefore the gslb contract will be also different. We have an option to support multiple versions of gslbs or document it and consider it as a breaking change in the operator. (aka use the correct version of k8gb with a correct version of ingress and gslb)

notable changes:

  • spec.backend is renamed to spec.defaultBackend
  • The backend serviceName field is renamed to service.name
  • Numeric backend servicePort fields are renamed to service.port.number
  • String backend servicePort fields are renamed to service.port.name
  • pathType is now required for each specified path. Options are Prefix, Exact, and ImplementationSpecific. To match the - undefined v1beta1 behavior, use ImplementationSpecific.

right, in theory we can handle this issue also on the helm chart level. Having those (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) and deploy older version of k8gb for older k8s clusters, but this smells like some auto-magic behavior and I am not a big fan of this approach, the less logic in helm, the better, imho

I was also looking into that possibility of having multiple versions of CRDs present at the same time (because this change also impacts the shape under .spec.ingress in our gslbs) which can be handy also in the future. There is a nice tutorial how to do that on kubebuilder web. But it requires a new webhook, cert-manager and what not. I've actually started this approach and then abandoned it after writing those conversion methods.