Writing
Setup Own Kubernetes Cluster via Virtualbox
Migrated post from old blog.
Table of Contents
Setup
Using vagrant spin up multiple virtual machines: vagrant up
The master node is ready we can ssh into the machine via: vagrant ssh master
(vagrant ssh worker-1 & vagrant ssh worker-2)
vagrant@master:~# sudo kubeadm init --apiserver-advertise-address 192.168.33.13 --pod-network-cidr=10.244.0.0/16
run the following command as an arbitrary user
$ mkdir -p $HOME/.kube
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
$ sudo chown $(id -u):$(id -g) $HOME/.kube/config
use flannel net plugin for the cluster network: kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
check health of Scheduler and Controller-panel: $ kubectl get cs
1.) vagrant ssh worker-1
2.) sudo kubeadm join 192.168.33.13:6443 --token bx86lo.agyszwr53ow5y53u \ --discovery-token-ca-cert-hash sha256:536b10417f411de9ff9f11cb83d286f9217f5031845df93355b3a6a5ed96c066
References:
https://medium.com/swlh/setup-own-kubernetes-cluster-via-virtualbox-99a82605bfcc
https://www.virtualbox.org/manual/ch06.html#network_hostonly https://stackoverflow.com/questions/69728426/e-accessdenied-when-creating-a-host-only-interface-on-virtualbox-via-vagrant