-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow ByteStash to work under subpath #21
Comments
@Trungtin1011 Use BASE_PATH environment variable to set the desired path. |
Hi @jordan-dalby, Thank you for your quick response. I've just tried with the new image and here are the results:
I very appreciate that you are listening to our requests and hope this can be done in the next release. |
@Trungtin1011 |
Here is my Ingress manifest: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
labels:
app: bytestash
name: bytestash
spec:
ingressClassName: nginx
rules:
- host: my-domain.com
http:
paths:
- backend:
service:
name: bytestash
port:
number: 5000
path: /bytestash
pathType: Prefix |
@Trungtin1011 Let me know if it works!
|
Hi @jordan-dalby, The above example did not work, because using rewrite-target for nginx requires I also tried with AWS LB Controller kind of Ingress but did not work. |
@Trungtin1011 I have one more idea on my end, but of course if we can fix this by modifying the ingress that would be best. |
In my opinion, if re-writing the target did not work, we have to try to update the application code. I think we should proceed with your other idea |
@Trungtin1011 Again, make sure that the base path is specified |
@Trungtin1011 Please reopen if you have any issues. |
Hi @jordan-dalby, Now I know why it did not work from my side. I'd pulled your branch and run locally with docker-compose and it worked. The funny thing is - the redirection of the URL has been done from the server internally - while it should be done from the Kubernetes Ingress side. If you have noticed, when you type for example http://localhost:5000, It immediately get redirected into http://localhost:5000/bytestash/ <- this is not really what everybody want. So, I made some change to my ingress configuration like this (of course with BASE_PATH=/bytestash env): apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: bytestash
spec:
ingressClassName: nginx
rules:
- host: my-domain.com
http:
paths:
- backend:
service:
name: bytestash
port:
number: 5000
path: /
pathType: ImplementationSpecific After I hit It failed when I change my Ingress path to /bytestash instead of just / - which is what I really want here. |
@Trungtin1011 |
Thank you for understanding @jordan-dalby My team is using you product for saving custom snippets and because we are currently hosting a lot of applications under 1 single Domain, adding support for subpath is really important and helpful. If you have time, please correct the behavior of ByteStash with subpath for Kubernetes. The correct behavior should be:
Thank you, |
@Trungtin1011 |
@Trungtin1011 |
I don't understand why removing the BASE_PATH environment variable? |
@Trungtin1011 ah ignore that. I figured out what the issue is. The client is built and served statically from /client/build, but when we use the ingress server these files are actually in /bytestash/client/build. This would be an easy fix if I could modify the client side code to use the /bytestash prefix but I can't do that without affecting everyone. The next best solution is to rewrite the requests when they come in to use the /bytestash prefix, but this is proving to be more tricky than anticipated! I am working on it. I will ping again when I have a proper build. |
@Trungtin1011 You do need to set BASE_PATH for the frontend to communicate with the API.
Let me know if it's fixed! |
Thank you @jordan-dalby, it works now 💯 I very appreciate your work during the last few days. Can't wait to see the new 1.3.0 version |
Hi, I currently figured out that ByteStash cannot be hosted under subpath for Ingress deployment on Kubernetes.
Can you by somehow add the feature so that ByteStash can be hosted under subpath (/bytestash)?
The text was updated successfully, but these errors were encountered: