<p>I am new to the world of kubernetes. I am trying to implement kubernetes advantages on my personal project.</p>

<p>I have an api service in a docker container which fetches data from back end.</p>

<p>I plan on creating multiple replicas of this api service container on a single external port in the kubernetes cluster. Do replicas share traffic if they're on a single node ?</p>

<p>My end goal is to create multiple instances of this api service to make my application faster(users can access one of the multiple api services which should reduce traffic on a single instance). </p>

<p>Am i thinking right in terms of kubernetes functionality?</p>

Harsha Jasti
<p>You are right, the multiple replicas of your API service will share the load. In Kubernetes, there is a concept of <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Services</a> which will send traffic to the backend and in this case it is your api application running in the pods. By default, the choice of backend is random. Also, it doesn't matter whether the Pods are running on a single node or on different nodes, the traffic will be distributed randomly among all the Pods based on the <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/" rel="nofollow noreferrer">labels</a>.</p>

<p>This will also make your application highly available because you will use deployment for specifying the number of replicas and whenever the number of available replicas are less than the desired replicas, Kubernetes will provision new pods to meet the desired state.</p>
