I am attempting to use an ingress controller within k8s to access my web servers running within the cluster. I am testing using path based routing ingress resources, and testing by accessing a worker IP address (as the ingress is using a node port service accessible through any of the worker nodes).
When I access other test web applications (without a login page), I am able to access my service as the following: http://{worker-ip}:{ingress-node-port}/{svc-name}
When I am trying to access an application that has a login page, I am redirected to the following after entering the above: http://{worker-ip}/vui/login
This obviously does not redirect me to the correct login page, and I am shown an error on the screen. Is there any way to hold the path and port name throughout this process so that the /vui/login path is sent with the correct service name and port number? If I input the entire path directly, I am still not able to access the service. I am thinking that since the path is changed to the correct login page, but cannot actually access the service, the redirection is working up to a certain point, and then failing out once the URL is changed to not use the path and service name.
Any advice on ingress, path based routing, and using them both with a login page redirection would be much appreciated.
Below is the ingress definition that I am using in my testing:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations: ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /test1
backend:
serviceName: test1-service
servicePort: 5678
- path: /test2
backend:
serviceName: test2-service
servicePort: 5678
- path: /test3
backend:
serviceName: test3-service
servicePort: 8080