Multiple ShinyProxy Instances With One Default
Closed this issue · 2 comments
Hi,
first, thanks for this amazing work!
I managed to run a minikube
cluster with distinct ShinyProxy
instances listening to different endpoints of our domain defined with
spec:
server:
servlet:
context-path: /sp{1..n}
However, I'm struggling to define one default instance, e.g. sp1
, listening to the root, i.e. https://shinyproxy-demo.local
the others to their respective endpoint, e.g. https://shinyproxy-demo.local/sp2
.
I tried to remove the servlet
statement from one of the deployment definitions but Skipper
responds with 404 - Not found
. Please see the Kubernetes config (k8s-config.txt) attached.
Is this scenario possible at all? If so, what should be configured differently?
Edit: Uploaded fixed config file.
Hi
This is not possible with the current implementations. The rules in the Skipper ingress are already fairly complex, so I believe it's not a good idea to further expand these.
What I propose is to use a redirect to the default instance. So if I user goes to https://shinyproxy-demo.local
, that they are automatically redirect to https://shinyproxy-demo.local/sp1
. (this will not happen if they directly go to https://shinyproxy-demo.local/sp2
.
If you are using nginx ingress this can be very easy, for example:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ngingx-to-skipper-ingress
namespace: kube-system
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/proxy-body-size: 5000m
nginx.ingress.kubernetes.io/proxy-read-timeout: "180"
nginx.ingress.kubernetes.io/proxy-send-timeout: "180"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/app-root: /test1
spec:
rules:
- host: operator-demo.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: skipper-ingress
port:
number: 9999
See the documentation for more information: https://kubernetes.github.io/ingress-nginx/examples/rewrite/#app-root
Hi
Thanks for your kind reply.
This is very helpful, I'll try that.