Curtis Botonis
Curtis Botonis

Reputation: 33

My containerized Node/React application works on Kubernetes locally, need help getting it to run on GCP GKE

I'm taking a course on Udemy to learn Microservices with Node for work. I have completed the first project which consists of 6 microservices, 1 being the react app and 5 services handling the logic. It works on my pc running Kubernetes through Docker Desktop but I am struggling getting it to run on Google Cloud GKE.

The original(local) project uses nginx to handle the ingress and Skaffold to manage the building of containers. I tried to launch it as is in GKE and everything seemed to work, pods and services started, but the external IP from the load balancer gave an nginx 404 error.

Then I decided I would try to deploy the containers on GKE without using nginx and use GCP's built in Load Balancers and services. I have the pods running but I think I'm getting lost with mapping the services/ports/Load Balancer to get it to work properly.

I have spent all day reading Google's documentation and they only provide examples for single service applications so I can't figure out how to make the 6 services all come together and work. I'm pretty new to GKE and would love some pointers from someone who is familiar with it.

Here is a link to my GitHub for the project, and thanks in advance for any help.

Upvotes: 1

Views: 232

Answers (1)

Goli Nikitha
Goli Nikitha

Reputation: 928

ClusterIP can resolve the issue.

Kubernetes creates a stable IP address that is accessible from nodes in the cluster.

If we have 3 different workloads(containers) running in pods of 3 different nodes and if we need to establish a connection between them, first we need to setup clusterIP service for 3 different nodes separately and then try interacting with them with their clusterIP and the TCP port specified in the port field.These requests are forwarded to one of the member Pods on the TCP port specified in the targetPort field.

Go through this video for a detailed understanding of clusterIP service and go through this documentation for how the service works.

Upvotes: 1

Related Questions