'Accessing an Endpoint in a Kubernetes Pod but get connection error

I'm learning microservice with docker and k8s. This project is a simple node.js express app and I tried to add a reverse proxy in it. I already pushed the image (both the express app as well as the reverse proxy) to my docker hub.

Now I encounter a problem when I tried to access an endpoint in my pods. My pod is running, and when I tried the endpoint:

curl:curl http://my-app-2-svc:8080/api/health

I get connection refused, I'm wondering what' wrong with that?

It seems that there are some problem with the liveness probe.. When I describe the pods: it shows:

Liveness probe failed: Get "http://192.168.55.232:8080/health": dial tcp 192.168.55.232:8080: connect: connection refused

enter image description here

Here is my github link for this project: https://github.com/floatingstarlight/Microservice

Can anyone helps me with that? Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source