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 tospec.defaultBackend
- The backend
serviceName
field is renamed toservice.name
- Numeric backend
servicePort
fields are renamed toservice.port.number
- String backend
servicePort
fields are renamed toservice.port.name
pathType
is now required for each specified path. Options are Prefix, Exact, and ImplementationSpecific. To match the - undefined v1beta1 behavior, use ImplementationSpecific.
@jkremser, this is how it was done in helm.sh for sample chart creation (with helm create
command):
https://github.com/helm/helm/pull/9621/files#diff-92d0c93dff3a254f887d928f60f6b46ad1da1cbe7a5737dda4cd85cd72876092R10
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.