-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
extending ingress url format #1008
extending ingress url format #1008
Conversation
b0102e7
to
e06454c
Compare
e06454c
to
9a24da6
Compare
@jinxingwang We might have the backward compatibility issue since the ingress URL format has been changed. |
There should be no backward compatibility issue, I only extended the feature. |
@liyinan926 Please review this PR. |
@liyinan926 Please take look again, thanks! |
Hi, awesome PR. I was going to do this myself. Just a question, why does the CRD change so much? |
@jacobhjkim Thanks. I think the CRD change may due to the previous PRs that didn't have it up to date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one question.
if err != nil { | ||
return nil, err | ||
} | ||
if parsedURL.Scheme == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still trying to understand why do you need this second Parse()? How does ingressURL look like typically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to solve the problem where URL parser can't parse the host & path correctly when there is no schema, so I am using the parser to check if the URL has a schema, if not add a schema to parse.
@jinxingwang Great work here. I also wanted to use path based routing instead of DNS based for the spark jobs. But I can't get it working. I am getting redirected to the
I saw your comment here, but still can't figure out how to do it with |
@kishorv06 Hi, I am happy to help you with the spark UI work. step2: will be sparkapplicaiton spec change to add annotation on the ingress when it is created step3: same as step 2, add the annotation to the ingress. Let me know if this is helping, the doc on how to get spark UI works, in my opinion, don't really belong to here, because spark operator is mostly config how spark works. it should be engineer's chose how they want to config sparkApplication to config spark to work base on their specific cases. |
Hi @jinxingwang, I followed your suggestion, but it is causing too many redirects. These are my configuration. sparkConf:
spark.ui.proxyBase: /foo
sparkUIOptions:
ingressAnnotations:
nginx.ingress.kubernetes.io/proxy-redirect-from: http://$host/
nginx.ingress.kubernetes.io/proxy-redirect-to: http://$host/foo/
nginx.ingress.kubernetes.io/rewrite-target: /$2 Spark operator: ingressUrlFormat: "example.com/foo" Result: curl -vvv "http://example.com/foo/jobs"
* Trying 192.168.2.102:80...
* TCP_NODELAY set
* Connected to example.com (192.168.2.102) port 80 (#0)
> GET /foo/jobs HTTP/1.1
> Host: example.com
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Server: nginx/1.17.10
< Date: Tue, 20 Oct 2020 06:54:19 GMT
< Content-Length: 0
< Connection: keep-alive
< Cache-Control: no-cache, no-store, must-revalidate
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Location: http://example.com/foo/jobs/
<
* Connection #0 to host example.com left intact Thanks in advance. |
After a lot of trial and error, finally got the path based routing to work on spark-operator. These are the configurations I have used. ingressUrlFormat: "example.com/foo(/|$)(.*)" Spark Application: sparkConf:
spatk.ui.proxyRedirectUri: http://example.com
spark.ui.proxyBase: /foo
sparkUIOptions:
ingressAnnotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2 Note: Executor tab is empty. I think it is a known bug as mentioned here: jupyterhub/jupyter-server-proxy#57 (comment) |
Nice, I guess I had an assumption which you have Nginx installed. that's where ```
|
Hi, I am try to use kong as ingress-controller,and follow this guide, but seem can't work.. but apply, get the ingress i find:
|
* init * add test case & documentation. * add additional on url
Issue created: #1007