<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">To Sanne’s point, I think HTTP(/2) would be a better longer term path if we think we can make it as efficient as current HR. But let’s evaluate the numbers of cycles to reach that point. Doing Seb’s approach might be a good first step.<div class="">Speaking of Sebastian, I have been discussing with Burr, Edson on the idea of a *node* sidecar (as opposed to a *pod* sidecar). To your problem, could you use Daemonset to enforce one Load Balancer per node or at least per project instead of one per pod deployed with Infinispan in it?</div><div class=""><br class=""></div><div class="">WDYT, is it possible?</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 30 May 2017, at 20:43, Sebastian Laskawiec &lt;<a href="mailto:slaskawi@redhat.com" class="">slaskawi@redhat.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hey guys!<div class=""><br class=""></div><div class="">Over past few weeks I've been working on accessing Infinispan cluster deployed inside Kubernetes from the outside world. The POC diagram looks like the following:</div><div class=""><br class=""></div><div class=""><span id="cid:15c58f5a1c0d0cad2201">&lt;pasted1.png&gt;</span><br class=""></div><div class=""><br class=""></div><div class="">As a reminder, the easiest (though not the most effective) way to do it is to expose a load balancer Service (or a Node Port Service) and access it using a client with basic intelligence (so that it doesn't try to update server list based on topology information). As you might expect, this won't give you much performance but at least you could access the cluster. Another approach is to use TLS/SNI but again, the performance would be even worse.</div><div class=""><br class=""></div><div class="">During the research I tried to answer this problem and created "External IP Controller" [1] (and corresponding Pull Request for mapping internal/external addresses [2]). The main idea is to create a controller deployed inside Kubernetes which will create (and destroy if not needed) a load balancer per Infinispan Pod. Additionally the controller exposes mapping between internal and external addresses which allows the client to properly update server list as well as consistent hash information. A full working example is located here [3].</div><div class=""><br class=""></div><div class="">The biggest question is whether it's worth it? The short answer is yes. Here are some benchmark results of performing 10k puts and 10k puts&amp;gets (please take them with a big grain of salt, I didn't optimize any server settings):</div><div class=""><ul class=""><li class="">Benchmark app deployed inside Kuberenetes and using internal addresses (baseline):</li><ul class=""><li class="">10k puts:&nbsp;674.244 ± &nbsp;16.654</li><li class="">10k puts&amp;gets:&nbsp;1288.437 ± 136.207</li></ul><li class="">Benchamrking app deployed in a VM outside of Kubernetes with basic intelligence:</li><ul class=""><li class=""><b class=""><font color="#990000" class="">10k puts:&nbsp;1465.567 ± 176.349</font></b></li><li class=""><b class=""><font color="#990000" class="">10k puts&amp;gets: 2684.984 ± 114.993</font></b></li></ul><li class="">Benchamrking app deployed in a VM outside of Kubernetes with address mapping and topology aware hashing:</li><ul class=""><li class=""><b class=""><font color="#38761d" class="">10k puts:&nbsp;1052.891 ± &nbsp;31.218</font></b></li><li class=""><b class=""><font color="#38761d" class="">10k puts&amp;gets: 2465.586 ± &nbsp;85.034</font></b></li></ul></ul></div><div class="">Note that benchmarking Infinispan from a VM might be very misleading since it depends on data center configuration. Benchmarks above definitely contain some delay between Google Compute Engine VM and a Kubernetes cluster deployed in Google Container Engine. How big is the delay? Hard to tell. What counts is the difference between client using basic intelligence and topology aware intelligence. And as you can see it's not that small.</div><div class=""><br class=""></div><div class="">So the bottom line - if you can, deploy your application along with Infinispan cluster inside Kubernetes. That's the fastest configuration since only iptables are involved. Otherwise use a load balancer per pod with External IP Controller. If you don't care about performance, just use basic client intelligence and expose everything using single load balancer.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Sebastian&nbsp;</div><div class=""><br class=""></div><div class="">[1]&nbsp;<a href="https://github.com/slaskawi/external-ip-proxy" class="">https://github.com/slaskawi/external-ip-proxy</a></div><div class="">[2]&nbsp;<a href="https://github.com/infinispan/infinispan/pull/5164" class="">https://github.com/infinispan/infinispan/pull/5164</a></div><div class="">[3]&nbsp;<a href="https://github.com/slaskawi/external-ip-proxy/tree/master/benchmark" class="">https://github.com/slaskawi/external-ip-proxy/tree/master/benchmark</a></div></div>
_______________________________________________<br class="">infinispan-dev mailing list<br class=""><a href="mailto:infinispan-dev@lists.jboss.org" class="">infinispan-dev@lists.jboss.org</a><br class="">https://lists.jboss.org/mailman/listinfo/infinispan-dev</div></blockquote></div><br class=""></div></body></html>