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

Use ingress v1 API #7145

Closed
aojea opened this issue May 18, 2021 · 13 comments · Fixed by #7156
Closed

Use ingress v1 API #7145

aojea opened this issue May 18, 2021 · 13 comments · Fixed by #7156
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@aojea
Copy link
Member

aojea commented May 18, 2021

Kubernetes has deprecated and removed the ingress v1beta1 API in kubernetes 1.22, all ingress implementation must support v1
k8s.io/api/networking/v1

EDIT

ingress-nginx must work against an apiserver that ONLY serves ingress/v1

/kind bug

@aojea aojea added the kind/bug Categorizes issue or PR as related to a bug. label May 18, 2021
@aojea aojea changed the title Support ingress v1 API Use ingress v1 API May 18, 2021
@tokers
Copy link
Contributor

tokers commented May 19, 2021

IMHO I think we should also be compatible with the v1beta1 version but do some jobs to guide users to migrate from v1beta1.

@aojea
Copy link
Member Author

aojea commented May 19, 2021

sorry for the description, it is misleading.

The problem here is that the code uses the v1beta1 api to talk to the apiserver, and it relies on the conversion done by the apiserver to implement the v1 features.

nginx-ingress has to use directly the v1 api in the code, i.e. sed s/v1beta1/v1/

internal/ingress/types.go:      networking "k8s.io/api/networking/v1beta1"
internal/ingress/controller/controller.go:      networking "k8s.io/api/networking/v1beta1"
internal/ingress/controller/location.go:        networking "k8s.io/api/networking/v1beta1"
internal/ingress/controller/controller_test.go: networking "k8s.io/api/networking/v1beta1"
internal/ingress/controller/store/ingress.go:   networking "k8s.io/api/networking/v1beta1"

otherwise it will not work against kubernetes 1.22+ versions

@tokers
Copy link
Contributor

tokers commented May 19, 2021

@aojea That code be done by adding another command-line option like :"--ingress-version".

@aojea
Copy link
Member Author

aojea commented May 19, 2021

@aojea That code be done by adding another command-line option like :"--ingress-version".

I don't think that is correct you must move to networking "k8s.io/api/networking/v1 the project, that is different than accepting v1beta1 manifest

@tokers
Copy link
Contributor

tokers commented May 20, 2021

@aojea That code be done by adding another command-line option like :"--ingress-version".

I don't think that is correct you must move to networking "k8s.io/api/networking/v1 the project, that is different than accepting v1beta1 manifest

I mean, as a widely used projecy, ingress-nginx itself should support both these ingress versions, but letting users to decide which version that they want to use in their project. I'm not talking about the differences between these two versions.

@aojea
Copy link
Member Author

aojea commented May 20, 2021

I mean, as a widely used projecy, ingress-nginx itself should support both these ingress versions, but letting users to decide which version that they want to use in their project. I'm not talking about the differences between these two versions.

That is not how Kubernetes API works :) beta is not a different version, it is an intermediate version to go to v1 and eventually, is deprecated and removed, that is what happened here. https://kubernetes.io/docs/reference/using-api/deprecation-policy/
I know that is a bit of a trauma for users, but for Kubernetes 1.22 onwards there is no choice, they have to use v1 always.
The question here is if.you want to nginx-ingress to support Kubernetes versions older than 1.18,(no longer supported versions) where there is no v1 ingress.
It's up to the project how to do it, the cleanest way I saw is to cut a new release saying since here only v1 is supported, it will work for Kubernetes versions 1.18+
Of course you can do a flag if you want to support Kubernetes 1.16 in this new version per example, but is a lot of work and painful to maintain

@tao12345666333
Copy link
Member

That is not how Kubernetes API works :) beta is not a different version, it is an intermediate version to go to v1 and eventually, is deprecated and removed, that is what happened here. https://kubernetes.io/docs/reference/using-api/deprecation-policy/

Yes I agree with you. This is the lifecycle of the Kubernetes API.

Although this is a widely used project, I think it should have its own compatibility matrix.

New versions are compatible with newer versions of Kubernetes, gradually dropping support for older versions.

@tao12345666333
Copy link
Member

We can discuss in the next community meeting.

@tokers
Copy link
Contributor

tokers commented May 21, 2021

We can discuss in the next community meeting.

Good point.

@rikatz
Copy link
Contributor

rikatz commented May 23, 2021

Agreed with Antonio

Let's discuss this on our next meeting. I'll try to attend as well.

I know, as a user that it might be hard to see things getting deprecated but also this will make the code maintenance and evolution much better, as now we have a GA API that is around there for a while.

@rikatz
Copy link
Contributor

rikatz commented May 23, 2021

/assign

@brianpursley
Copy link
Member

+1 for this issue. Can confirm it does not work w/ a 1.22 cluster.

From my controller logs:

E0615 21:23:46.322275       8 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource

@justinmchase
Copy link

The cluster I am using is older and it would be great if there was a solution to continue forward while still supporting the older ingressclass version for a period of time at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants