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

ingress resource giving error and not getting created for shinyproxy #27

Closed
aupadh12 opened this issue Feb 28, 2022 · 3 comments
Closed
Labels
question Further information is requested

Comments

@aupadh12
Copy link

Hi Team,

I am using shinyproxy 2.6.0 with operator.
After upgrading to the latest ingress controller on my EKs cluster, we had to use ingressClassname and use it inside ingress.yaml file as below instead of the annotation.
spec:
ingressClassName: nginx
But we have noticed that the ingress created by skipper has class as nginx although the ingress which gets created by operator for shinyproxy instance is of class skipper.
The issue is I am getting below error :

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://172.20.0.1/apis/networking.k8s.io/v1beta1/namespaces/shinyproxy/ingresses. Message: admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: host "shinyproxy-example.com" and path "/" is already defined in ingress kube-system/ngingx-to-skipper-ingress. Received status: Status(apiVersion=v1, code=400, details=null, kind=Status, message=admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: host "shinyproxy-example.com" and path "/" is already defined in ingress kube-system/ngingx-to-skipper-ingress, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=BadRequest, status=Failure, additionalProperties={}).

This is probably happening due to different names of ingress while both creating the same host and path.
Is there something which I could do to fix this issue?
I have to upgrade ingress controller when I start using kubernetes version 1.22 onwards due to below reasons:

Ingress API deprecation for extensions/v1beta1. As of Kubernetes 1.16 this API has been deprecated and is unavailable in 1.22. So should migrate to the stable networking.k8s.io/v1 version.

Ingress Class Annotation deprecation - As of Kubernetes 1.18 the kubernetes.io/ingress.class annotation has been deprecated in favor of the ingressClassName. So we have to migrate away from the annotation and start using the new ingressClassName setting.
More Details - https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation

@aupadh12
Copy link
Author

Hello,

On further evaluation, I found that in the ingress created by operator for shinyproxy , ingress class is mentioned as annotation.
But that is no more valid in the newer version which I am using and so, the validation webhook for ingress controller assumes that no class name is defined and as a result, it takes nginx as a default ingressclass and this issue is happening.
If there is way to move this as below:

spec:
ingressClassName: skipper

Then the validation webhook will not apply and this issue will be fixed.
This should be considered a breaking change for newer version of kubernetes of should be fixed as soon as possible.

@LEDfan
Copy link
Member

LEDfan commented Mar 1, 2022

Hi

This issue is unfortunately a known problem. However, the underlying issue is a bug in the ingress controller. It's unrelated to the replacement of the ingressClass annotation into a dedicated field (i.e. because of the update of the ingress resource). The problem is caused by a bug in the validation webhook of the ingress module: kubernetes/ingress-nginx#7546
Basically starting from version 1.0.0 of the ingress module, it ignores both the ingressClass field and annotation when validating ingress. This is now fixed and this will be soon released as part of 1.1.2 kubernetes/ingress-nginx#8274 . You can already test this with the following image: gcr.io/k8s-staging-ingress-nginx/controller:v1.1.2 . Our internal tests shows that this solves the problem.

To conclude, for fixing this bug there is no need to update the operator. Of course if we want to support k8s 1.22 we do have to update the operator and we will do this soon.

Since this is mostly related to the operator, I will transfer this issue to the ShinyProxy operator repo.

@LEDfan LEDfan transferred this issue from openanalytics/shinyproxy Mar 1, 2022
@LEDfan LEDfan added the question Further information is requested label Mar 1, 2022
@aupadh12
Copy link
Author

aupadh12 commented Mar 4, 2022

Hi,

Thank you for explaining this.
I see the new version 1.1.2 with a fix for validation webhook is now available.
closing this issue.

@aupadh12 aupadh12 closed this as completed Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants