<div dir="ltr">Hey!<div><br></div><div>I&#39;ve been playing with Kubernetes PetSets [1] for a while and I&#39;d like to share some thoughts. Before I dig in, let me give you some PetSets highlights:</div><div><ul><li>PetSets are alpha resources for managing stateful apps in Kubernetes 1.3 (and OpenShift Origin 1.3).</li><li>Since this is an alpha resource, there are no guarantees about backwards compatibility. Alpha resources can also be disabled in some public cloud providers (you can control which API versions are accessible [2]).</li><li>PetSets allows starting pods in sequence (not relevant for us, but this is a killer feature for master-slave systems).</li><li>Each Pod has it&#39;s own unique entry in DNS, which makes discovery very simple (I&#39;ll dig into that a bit later)</li><li>Volumes are always mounted to the same Pods, which is very important in Cache Store scenarios when we restart pods (e.g. Rolling Upgrades [3]).</li></ul><div>Thoughts and ideas after spending some time playing with this feature:</div></div><div><ul><li>PetSets make discovery a lot easier. It&#39;s a combination of two things - Headless Services [4] which create multiple A records in DNS and predictable host names. Each Pod has it&#39;s own unique DNS entry following pattern: {PetSetName}-{PodIndex}.{ServiceName} [5]. Here&#39;s an example of an Infinispan PetSet deployed on my local cluster [6]. As you can see we have all domain names and IPs from a single DNS query.</li><li>Maybe we could perform discovery using this mechanism? I&#39;m aware of DNS discovery implemented in KUBE_PING [7][8] but the code looks trivial [9] so maybe it should be implement inside JGroups? @Bela - WDYT?</li><li>PetSets do not integrate well with OpenShift &#39;new-app&#39; command. In other words, our users will need to use provided yaml (or json) files to create Infinispan cluster. It&#39;s not a show-stopper but it&#39;s a bit less convenient than &#39;oc new-app&#39;.<br></li><li>Since PetSets are alpha resources they need to be considered as secondary way to deploy Infinispan on Kubernetes and OpenShift.</li><li>Finally, the persistent volumes - since a Pod always gets the same volume, it would be safe to use any file-based cache store.</li></ul><div>If you&#39;d like to play with PetSets on your local environment, here are necessary yaml files [10].</div></div><div><br></div><div>Thanks</div><div>Sebastian</div><div><br></div><div><div><br></div></div><div>[1] <a href="http://kubernetes.io/docs/user-guide/petset/">http://kubernetes.io/docs/user-guide/petset/</a></div><div>[2] For checking which APIs are accessible, use &#39;kubectl api-versions&#39;</div><div>[3] <a href="http://infinispan.org/docs/stable/user_guide/user_guide.html#_Rolling_chapter">http://infinispan.org/docs/stable/user_guide/user_guide.html#_Rolling_chapter</a></div><div>[4] <a href="http://kubernetes.io/docs/user-guide/services/#headless-services">http://kubernetes.io/docs/user-guide/services/#headless-services</a></div><div>[5] <a href="http://kubernetes.io/docs/user-guide/petset/#peer-discovery">http://kubernetes.io/docs/user-guide/petset/#peer-discovery</a></div><div>[6] <a href="https://gist.github.com/slaskawi/0866e63a39276f8ab66376229716a676">https://gist.github.com/slaskawi/0866e63a39276f8ab66376229716a676</a></div><div>[7] <a href="https://github.com/jboss-openshift/openshift-ping/tree/master/dns">https://github.com/jboss-openshift/openshift-ping/tree/master/dns</a></div><div>[8] <a href="https://github.com/jgroups-extras/jgroups-kubernetes/tree/master/dns">https://github.com/jgroups-extras/jgroups-kubernetes/tree/master/dns</a></div><div>[9] <a href="http://stackoverflow.com/a/12405896/562699">http://stackoverflow.com/a/12405896/562699</a></div><div>[10] You might need to adjust ImageStream. <a href="https://gist.github.com/slaskawi/7cffb5588dabb770f654557579c5f2d0">https://gist.github.com/slaskawi/7cffb5588dabb770f654557579c5f2d0</a><br></div></div>