-
Notifications
You must be signed in to change notification settings - Fork 402
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
[Bug] Fail to create ingress due to the deprecation of the ingress.class annotation #646
Conversation
technically, we don't like to support version < 1.19 since ingress api has been updated. We internally have similar issue but make some customization. https://opensource.googleblog.com/2020/09/kubernetes-ingress-goes-ga.html BTW, in public cloud, I don't think there're still 1.18 clusters? |
Thank @Jeffwan for this information! I am a little confused about your comments. This PR does not support Kubernetes < 1.19. Can you explain more about your concerns? Thank you! |
Sorry for unclear comments. I mean the user should not use the deprecated annotation in earlier versions and this validation logic looks good to me. I was wondering why user still give the annotation on > 1.19 clusters? probably forget to clean them up after upgrade |
Thank you for your explanation! In my opinion, some users followed the KubeRay doc to add the Honestly, I really agreed with you that the logic is weird. Do you have any thoughts on the following two methods? (1) Keep backward compatibility with weird logic (deprecated annotation) => current logic |
@kevin85421 Thanks for fast bugfix. I have tried the code changes and ingress can be created. However, when I visit http://{domain}/cluster_name, "404 Not Found" shows up.
|
As @rokiyer said, user needs to give additional annotations to make Ingress work. for short term, I think current PR should be ok. for 2nd option, I suggest we use a specific annotation instead a new field to present the class name. |
Maybe I can open an issue to track the ingress support in KubeRay. We can discuss more details about ingress in next community sync meeting: (1) All annotations in RayCluster will be passed to Ingress |
TBH, I don't think it makes sense for the operator to have been built-in ingress support; details of ingress set-up are sensitive to cloud provider context and user requirements.
Some discussion of how to set up an ingress in the docs would be great. My opinions:
We don't need to prioritize this. Given that ingress support is already there, we should get things to a state where basic use-cases are covered. Then we can document the limitations of the built-in support and explain how to set up an ingress yourself.
I also don't think we should stress about this -- just don't introduce any config structure incompatibilities (don't delete fields). Either new field or a custom annotation seems fine to me. A custom annotation might be better initially since we're feeling pretty iffy about the ingress support in general at the moment. The only important thing is to clearly document the solution we choose. |
Thank @DmitriGekhtman for your reply! I will write the documents about: (1) Limitations of KubeRay's built-in ingress support: I still need to figure out the limitation. Currently, I just understand Nginx, and I will start to work on #637 to study the support of AWS LoadBalancer. (2) Tell users how to set up ingress by themselves. By the way, do we need to add "custom annotation" support in this PR? Thank you! |
This PR is fine as is, I think. |
This one looks good. We can have a separate issue/PR for further improvement. |
…ass annotation (ray-project#646) * update * update * add test * update
Why are these changes needed?
This issue is not totally same as #441, and thus I opened a new issue. Users cannot create
ingress
with the instructions in https://ray-project.github.io/kuberay/guidance/ingress/. The operator also reports the error message:As shown in the following code snippet, the error message is reported by the function
ValidateIngressCreate
(Link) in Kubernetes. When bothannotations.kubernetes.io/ingress.class
andspec.IngressClassName
are set at the same time, the validation function will report the error "can not be set when the class field is also set". This PR only setsspec.IngressClassName
and avoids settingannotations.kubernetes.io/ingress.class
.In doc, it indicates that
annotations.kubernetes.io/ingress.class
was deprecated in Kubernetes 1.18, andspec.ingressClassName
is a replacement for this annotation.Related issue number
Closes #645
#441
Checks
Update
Thank @rokiyer for pointing this out!
Based on @rokiyer comments, we need to add additional annotations and update the path-matching pattern in the ingress. To elaborate,
(1) ingress.go:
Path: "/" + cluster.Name
=>Path: "/" + cluster.Name + "/(.*)"
(Note:(.*)
is regex.)(2) YAML file:
nginx.ingress.kubernetes.io/rewrite-target: /$1
(rewrite-target doc)For example, the ingress definition above will result in the following rewrites:
$IP/$CLUSTER_NAME/
rewrites to$IP/
($1
maps to nothing)$IP/$CLUSTER_NAME/#/actors
rewrites to$IP/#/actors
($1
maps to#/actors
)$IP/$CLUSTER_NAME/#/node
rewrites to$IP/#/node
($1
maps to#/node
)Checks