简体   繁体   中英

Not able to run tomcat container in kubernetes after exposing it as a service

I have created kubernetes cluster in Google could engine. I am running two pods in kubernetes and each pod has tomcat container running. I want to access this tomcat application outside the cluster that is through my browser or curl command. I have created a service as load balancer which gave me one external ip address and port. When im trying to browser http://:port, it does not respond, it says connection time out. I have also opened a firewall for this ip address and the specific port.

Can somebody please help me to find out if im missing anything here. I have followed all docs and even tried running it as service as node_port but that also did not work.

Thanks Abhishek Somani

  1. Have you properly exposed the Container port 8080 of Tomcat to Host Port?
  2. Are Service and Pod labels inline?
  3. Forget about nodeport & ingress traffic, try to Curl the sample.war url from within the cluster or another container in Pod.
  4. Expose the Pod properly.
  5. Even if you are using nodeport, try to curl on http://<>:<>/sample. This will make sure that the service is getting exposed outside of Pod. NodeIP should be the IP of node running the pod, to reduce the debugging complications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM