<p>I have a UI application written in Angular, which has a backend running in NodeJS. I also have two other services which will be invoked from the NodeJS backend. These applications are running in docker containers and are deployed to a Kubernetes cluster in AWS. </p>

<p>The flow is like this:</p>

<p>AngularUI -> NodeJS -> Service1/Service2</p>

<p>AngularUI &amp; NodeJS are in the same docker container, while the other two services are in 2 separate containers.</p>

<p>I have been able to get the services running in Kubernetes on AWS. Service to Service calls (Service 1-> Service2) work fine, as I'm invoking them using k8s labels.</p>

<p>Now Im not able to figure out how to make calls from the Angular front end to the NodeJS backend, since the requests execute on the client side. I cannot give the IP of the ELB of the service, as the IP changes with every deployment.</p>

<p>I tried creating an AWS API Gateway which points to the ELB IP of the Angular UI, but that does not serve up the page. </p>

<p>What is the right way to do this? Any help is much appreciated.</p>

<p>The ELB has a static DNS hostname, like <code>foobar.eu-west-4.elb.amazonaws.com</code>. When you have a domain at hand, create an A record (alias) that points to this DNS hostname. E.g.</p>

<pre><code>webservice.mydomain.com -&gt; mywebservicelb.eu-west-4.elb.amazonaws.com
</code></pre>

<hr>

<p>You can also use static ip address, which seems to be a fairly new feature:</p>

<blockquote>
  <p>Each Network Load Balancer provides a single IP address for each
  Availability Zone in its purview. If you have targets in us-west-2a
  and other targets in us-west-2c, NLB will create and manage two IP
  addresses (one per AZ); connections to that IP address will spread
  traffic across the instances in all the VPC subnets in the AZ. You can
  also specify an existing Elastic IP for each AZ for even greater
  control. With full control over your IP addresses, Network Load
  Balancer can be used in situations where IP addresses need to be
  hard-coded into DNS records, customer firewall rules, and so forth.</p>
</blockquote>

<p><a href="https://aws.amazon.com/de/blogs/aws/new-network-load-balancer-effortless-scaling-to-millions-of-requests-per-second/" rel="nofollow noreferrer">https://aws.amazon.com/de/blogs/aws/new-network-load-balancer-effortless-scaling-to-millions-of-requests-per-second/</a></p>
