Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Ingress @ networking.k8s.io/v1 #847

Closed
jkremser opened this issue Feb 17, 2022 · 2 comments · Fixed by #854
Closed

Support for Ingress @ networking.k8s.io/v1 #847

jkremser opened this issue Feb 17, 2022 · 2 comments · Fixed by #854

Comments

@jkremser
Copy link
Member

jkremser commented Feb 17, 2022

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.
@somaritane
Copy link
Contributor

@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

@jkremser
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants