1
votes

Let me start this by saying I am fairly new to k8s. I'm using kops on aws.

I currently have 3 deployments on a cluster.

  • FrontEnd nginx image serving an angular web app. One pod. External service.

  • socket.io server. Internal service. (this is a chat application, and we decided to separate this server from our api. Was this a good idea?)

  • API that is requested by both the socket.io server and the web application. Internal Service (should it be external?)

The socket.io deployment and API seem to be able to communicate through the cluster ips and corresponding services I have set up for the deployments; however, the webapp times out when querying the API.

From the web app, I am querying the API using the API's cluster IP address. Should I be requesting a different address?


Additionally, what is the best way to configure these addresses in my files without having to change the addresses in the files each time I create a new deployment? (the cluster ip addresses change every time you tare down and recreate the deployment)

1

1 Answers

0
votes

If I understood correctly your frontend web application depends on API server, so that it sends requests to it. In such case, your API service should be available from outside of the cluster. It means it should be exposed as the NodePort or LoadBalancer service type.

P.S. you can refer to service using ClusterIP only inside of the cluster.