<div dir="ltr">On Fri, Aug 19, 2016 at 10:18 AM, Bela Ban <span dir="ltr">&lt;<a href="mailto:bban@redhat.com" target="_blank">bban@redhat.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Sebastian<br>
<br>
the usual restrictions apply: if DNS discovery depends on external libs,<br>
then it should be hosted in jgroups-extras, otherwise we can add it to<br>
JGroups itself.<br></blockquote><div><br><br></div><div>Bela, you forgot to mention an extra restriction: even if it has no external deps, it should<br></div><div>not be too big in terms of LOC (what is the threshold?)  ;)<br><br></div><div>Gustavo <br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
On 19/08/16 11:00, Sebastian Laskawiec wrote:<br>
&gt; Hey!<br>
&gt;<br>
&gt; I&#39;ve been playing with Kubernetes PetSets [1] for a while and I&#39;d like<br>
&gt; to share some thoughts. Before I dig in, let me give you some PetSets<br>
&gt; highlights:<br>
&gt;<br>
</span>&gt;   * PetSets are alpha resources for managing stateful apps in Kubernetes<br>
<span class="">&gt;     1.3 (and OpenShift Origin 1.3).<br>
</span>&gt;   * Since this is an alpha resource, there are no guarantees about<br>
<span class="">&gt;     backwards compatibility. Alpha resources can also be disabled in<br>
&gt;     some public cloud providers (you can control which API versions are<br>
&gt;     accessible [2]).<br>
</span>&gt;   * PetSets allows starting pods in sequence (not relevant for us, but<br>
<span class="">&gt;     this is a killer feature for master-slave systems).<br>
</span>&gt;   * Each Pod has it&#39;s own unique entry in DNS, which makes discovery<br>
<span class="">&gt;     very simple (I&#39;ll dig into that a bit later)<br>
</span>&gt;   * Volumes are always mounted to the same Pods, which is very important<br>
<span class="">&gt;     in Cache Store scenarios when we restart pods (e.g. Rolling Upgrades<br>
&gt;     [3]).<br>
&gt;<br>
&gt; Thoughts and ideas after spending some time playing with this feature:<br>
&gt;<br>
</span>&gt;   * PetSets make discovery a lot easier. It&#39;s a combination of two<br>
<span class="">&gt;     things - Headless Services [4] which create multiple A records in<br>
&gt;     DNS and predictable host names. Each Pod has it&#39;s own unique DNS<br>
&gt;     entry following pattern: {PetSetName}-{PodIndex}.{<wbr>ServiceName} [5].<br>
&gt;     Here&#39;s an example of an Infinispan PetSet deployed on my local<br>
&gt;     cluster [6]. As you can see we have all domain names and IPs from a<br>
&gt;     single DNS query.<br>
</span>&gt;   * Maybe we could perform discovery using this mechanism? I&#39;m aware of<br>
<span class="">&gt;     DNS discovery implemented in KUBE_PING [7][8] but the code looks<br>
&gt;     trivial [9] so maybe it should be implement inside JGroups? @Bela -<br>
&gt;     WDYT?<br>
</span>&gt;   * PetSets do not integrate well with OpenShift &#39;new-app&#39; command. In<br>
<span class="">&gt;     other words, our users will need to use provided yaml (or json)<br>
&gt;     files to create Infinispan cluster. It&#39;s not a show-stopper but it&#39;s<br>
&gt;     a bit less convenient than &#39;oc new-app&#39;.<br>
</span>&gt;   * Since PetSets are alpha resources they need to be considered as<br>
<span class="">&gt;     secondary way to deploy Infinispan on Kubernetes and OpenShift.<br>
</span>&gt;   * Finally, the persistent volumes - since a Pod always gets the same<br>
<div class="HOEnZb"><div class="h5">&gt;     volume, it would be safe to use any file-based cache store.<br>
&gt;<br>
&gt; If you&#39;d like to play with PetSets on your local environment, here are<br>
&gt; necessary yaml files [10].<br>
&gt;<br>
&gt; Thanks<br>
&gt; Sebastian<br>
&gt;<br>
&gt;<br>
&gt; [1] <a href="http://kubernetes.io/docs/user-guide/petset/" rel="noreferrer" target="_blank">http://kubernetes.io/docs/<wbr>user-guide/petset/</a><br>
&gt; [2] For checking which APIs are accessible, use &#39;kubectl api-versions&#39;<br>
&gt; [3]<br>
&gt; <a href="http://infinispan.org/docs/stable/user_guide/user_guide.html#_Rolling_chapter" rel="noreferrer" target="_blank">http://infinispan.org/docs/<wbr>stable/user_guide/user_guide.<wbr>html#_Rolling_chapter</a><br>
&gt; [4] <a href="http://kubernetes.io/docs/user-guide/services/#headless-services" rel="noreferrer" target="_blank">http://kubernetes.io/docs/<wbr>user-guide/services/#headless-<wbr>services</a><br>
&gt; [5] <a href="http://kubernetes.io/docs/user-guide/petset/#peer-discovery" rel="noreferrer" target="_blank">http://kubernetes.io/docs/<wbr>user-guide/petset/#peer-<wbr>discovery</a><br>
&gt; [6] <a href="https://gist.github.com/slaskawi/0866e63a39276f8ab66376229716a676" rel="noreferrer" target="_blank">https://gist.github.com/<wbr>slaskawi/<wbr>0866e63a39276f8ab66376229716a6<wbr>76</a><br>
&gt; [7] <a href="https://github.com/jboss-openshift/openshift-ping/tree/master/dns" rel="noreferrer" target="_blank">https://github.com/jboss-<wbr>openshift/openshift-ping/tree/<wbr>master/dns</a><br>
&gt; [8] <a href="https://github.com/jgroups-extras/jgroups-kubernetes/tree/master/dns" rel="noreferrer" target="_blank">https://github.com/jgroups-<wbr>extras/jgroups-kubernetes/<wbr>tree/master/dns</a><br>
&gt; [9] <a href="http://stackoverflow.com/a/12405896/562699" rel="noreferrer" target="_blank">http://stackoverflow.com/a/<wbr>12405896/562699</a><br>
&gt; [10] You might need to adjust ImageStream.<br>
&gt; <a href="https://gist.github.com/slaskawi/7cffb5588dabb770f654557579c5f2d0" rel="noreferrer" target="_blank">https://gist.github.com/<wbr>slaskawi/<wbr>7cffb5588dabb770f654557579c5f2<wbr>d0</a><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Bela Ban, JGroups lead (<a href="http://www.jgroups.org" rel="noreferrer" target="_blank">http://www.jgroups.org</a>)<br>
<br>
______________________________<wbr>_________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/infinispan-<wbr>dev</a><br>
</font></span></blockquote></div><br></div></div>