<p>I am deploying the microservice benchmark <a href="https://github.com/delimitrou/DeathStarBench/tree/master/socialNetwork" rel="nofollow noreferrer">here</a> using helm charts.</p>
<p>However, when I uninstall the helm chart and re-install (basically, equivalent to re-deploying all kubernetes pods), the IP addresses change. Specifically, the IP addresses keep on increasing on subsequent runs. Here is the workflow:</p>
<pre class="lang-bash prettyprint-override"><code>$ helm install social-network ./socialnetwork
$ kubectl get pods -o custom-columns=PodName:.metadata.name,PodIP:.status.podIP
PodName                                   PodIP
compose-post-service-866f6d7b74-rzqh6     10.244.0.198   
home-timeline-redis-7994f7cb85-8fjlh      10.244.0.199
...
$ helm uninstall social-network
...
$ helm install social-network ./socialnetwork
$ kubectl get pods -o custom-columns=PodName:.metadata.name,PodIP:.status.podIP
PodName                                   PodIP      
compose-post-service-866f6d7b74-2d4jf     10.244.0.254   
home-timeline-redis-7994f7cb85-dc8jn      10.244.0.250
</code></pre>
<p>My concern is that for my development and testing, I need to re-deploy the benchmark several times.</p>
<p>Is there a limit to how many times I can restart the application? If so, how can I force Kubernetes to reuse the same IP addresses?</p>

diviquery
<blockquote>
<p>Is there a limit to how many times I can restart the application?</p>
</blockquote>
<p>No, there is no limit.</p>
<blockquote>
<p>If so, how can I force Kubernetes to reuse the same IP addresses?</p>
</blockquote>
<p>There is no need for that since inside the CNI (Container Network Interface, your network plugin e.g. Calico, Cilium, ...) there is an <a href="https://www.cni.dev/plugins/current/ipam/" rel="nofollow noreferrer">IPAM</a> (IP Address Management) running, which takes care of assigning a subnet to a node, which then is used to give a Pod an IP via DHCP.</p>
<p>If you would like to connect to your pod, you should use a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Kubernetes Service</a></p>
