ingress port getting redirected in kubernetes

0 votes

I have a java application that works perfectly fine on my local machine but when i deployed it on kubernetes ingress, the port gets redirected/forwarded. 

On my local, following url is working correctly.

http://www.example.com:9080/app/eh
https://www.example.com:9443/app/eh
https://www.example.com/app/eh

On the kubernetes env..

http://www.example2.com/app/eh (working)
https://www.example2.com/app/eh (expected)
https://www.example2.com:80/app/eh (real result)

When I access the https://www.example2.com/app/eh/xxxx page, it takes me to the https://www.example2.com:80/app/eh, rather than https://www.example2.com/app/eh.

kubectl get ing thcaas-eh
NAME        HOSTS   ADDRESS            PORTS     AGE
thcaas-eh   www.example2.com   158.87.63.26,...   80, 443   2d

kubectl describe ing thcaas-eh
Name:             thcaas-eh
Namespace:        thcaas-dev
Address:          158.87.63.26,158.87.63.27
Default backend:  default-http-backend:80 (100.127.50.199:8080)
TLS:
  tls.thcaas.icp1 terminates www.example2.com
Rules:
  Host                                              Path  Backends
  ----                                              ----  --------
  www.example2.com  
                                                    /app/eh   eh:9080 (<none>)
Annotations:
  ssl-redirect:         true
  tls-minimum-version:  1.2
Events:
  Type    Reason  Age               From                      Message
  ----    ------  ----              ----                      -------
  Normal  UPDATE  45m (x8 over 2d)  nginx-ingress-controller  Ingress thcaas-dev/thcaas-eh
  Normal  UPDATE  44m (x8 over 2d)  nginx-ingress-controller  Ingress thcaas-dev/thcaas-eh

How can i make it's working on the port 443? Takes me to the page, https://www.example2.com/app/eh

Sep 10, 2018 in Kubernetes by lina
• 8,100 points
27 views

1 answer to this question.

0 votes

Try the following, it worked for me

Changed to following, works.

from: Rules:
      Host                                              Path  Backends
      ----                                              ----  --------
      www.example2.com 
                                                        /app/eh   eh:9080 (<none>)

to: Rules:
          Host                                              Path  Backends
          ----                                              ----  --------
          www.example2.com 
                                                            /app/eh/   eh:9080 (<none>)
answered Sep 10, 2018 by Kalgi
• 37,430 points

Related Questions In Kubernetes

0 votes
2 answers

single point of entry for multiple services in kubernetes ingress

I tried having something similar too. Deployment apiVersion: extensions/v1beta1 kind: ...READ MORE

answered Sep 7, 2018 in Kubernetes by Hannah
• 14,080 points
87 views
0 votes
1 answer

Customize the routing logic in kubernetes ingress controller

Try building your own customized image based on ...READ MORE

answered Sep 7, 2018 in Kubernetes by Kalgi
• 37,430 points
73 views
0 votes
1 answer

Ingress nginx loading resource 404 in kubernetes

This is not a routing problem on ...READ MORE

answered Sep 10, 2018 in Kubernetes by Kalgi
• 37,430 points
659 views
0 votes
2 answers

Not able to expose port 80 on the host, kubernetes ingress

I was facing the same error. The nginix ...READ MORE

answered Sep 11, 2018 in Kubernetes by Kalgi
• 37,430 points
61 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
1,180 views
+3 votes
1 answer
0 votes
1 answer

Filter source ip in kubernetes ingress in GCE

This feature currently works only with nginx. Example ...READ MORE

answered Sep 7, 2018 in Kubernetes by Kalgi
• 37,430 points
182 views