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,220 points
825 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
• 52,350 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
• 18,520 points
2,699 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
• 52,350 points
1,333 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
• 52,350 points
8,142 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
• 52,350 points
2,123 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
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
• 52,350 points
1,261 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP