Often times, we need a kubernetes cluster to try out something new real quick or to use it on a daily basis for our development work. It's like back old days when every so often we needed a tomcat, WebLogic, WebSphere server at your disposal.
Setting up kubernetes cluster is not difficult at all - but you still need to pass through few hoops like installing a runtime/k8s artifacts, configuring a CNI plugin etc. It becomes a hassle if we have to carry out the same steps on multiple worker machines every now and then.
Here is a simple script that can spin off a kubernetes cluster in a matter of minutes, a CNI plugin installed and a demo POD deployed - all up and running. No manual intervention. All we need is SSH root or sudo access. Below are sneak pics:
1. We provision three compute VMs across 3 geo-graphic locations (Just for the fun of it!)
2. We SSH to the mgnt-server. This we would use as one of the two worker nodes. Generate a SSH key pair.
3. Apply the public key to master and worker nodes' authorized_keys.
4. We check out the git repository containing the cluster launch script and proceed to edit the setup.conf file.
5. Edit the setup.conf for worker and master nodes.
6. And launch the cluster creation.
7. Cluster creation progress - worker joining the cluster.
8. CNI plugin getting deployed.
9. Cluster should ready in matter of minutes.
git repository: https://github.com/ratulb/k8s-remote-install