<p>I am a student and have to make a Bachelor thesis for my school. Is it possible to make a hybrid Kubernetes cluster, and how is this possible?</p>
<p>Is there a good application I can run in this cluster to show that it works?</p>
<p>I have made an AKS cluster and a on-prem cluster. Then I made a nginx loadbalancer and loadbalanced the 2, but the application isn't synced (which is logical). I tried using rancher but somehow I always got errors while trying to make a local cluster. Is it possible to have the storages synced somehow and be able to control the 2 clusters from one place or just make them one cluster? I have found you can use Azure Arc with azure AKS, is this a viable solution? Should I use a VPN instead?</p>

Florian
<p>If by hybrid k8s cluster you mean a cluster that has nodes over different cloud providers, then yes that is entirely possible.</p>
<p>You can create a simple example cluster of this by using <a href="https://docs.k3s.io/" rel="nofollow noreferrer">k3s</a> (lightweight Kubernetes) and then using the <a href="https://docs.k3s.io/installation/network-options#distributed-hybrid-or-multicloud-cluster" rel="nofollow noreferrer">--node-external-ip</a> flag. This tells your nodes to talk to eachother via their public IP.</p>
<p>This sort of setup is described in <a href="https://kubernetes.io/docs/setup/best-practices/multiple-zones/" rel="nofollow noreferrer">Running in Multiple Zones</a> on the Kubernetes Documentation. You will have to configure the different places you place nodes at as different zones.<br />
You can fix storage on a cluster like this by using CSI drivers for the different environments you use, like AWS, GCP, AKS, etc. When you then deploy a PVC and it creates a PV at AWS for example, when you mount this volume on a pod, that pod will always be scheduled in the zone the PV resides in, otherwise scheduling will be impossible.</p>
<p>I personally am not running this set up in production, but I am using a technique that also suits this multiple zones idea with regards to networking. To save money on my personal cluster, I am telling my Nginx ingress controller to not make a LoadBalancer resource and to run the controllers as a DaemonSet. The Nginx controller pods have a HostPort open on the node they run on (since its a DaemonSet there won't be more than one of those pods per node) and this HostPort opens ports 80 and 443 on the host. When you then add more nodes, every one of the nodes with an ingress controller pod on it will become an ingress entrypoint. Just set up your DNS records to include all of those nodes and you'll have them load balanced.</p>
