Kubernetes cluster using Ansible and Vagrant
You'll need the following installed on your workstation
git clone https://github.com/Ammly/k8s-cluster.git
cd k8s-cluster
vagrant up
This will set up the following
- A master node called
k8s-master
- 2 worker nodes
k8s-worker-1
andk8s-worker-2
vagrant ssh k8s-master
vagrant ssh k8s-worker-1
vagrant ssh k8s-worker-2
To access your cluster from your host, run the following command to copy kube config from k8s-master
to your home dir
scp vagrant@k8s-master.test:/etc/kubernetes/admin.conf ~/.kube/config
Alternatively you can install vagrant scp
plugin and run the following
vagrant scp k8s-master:/etc/kubernetes/admin.conf ~/.kube/config
Create .kube/
directory if it doesn't exist
kubectl cluster-info
kubectl get nodes
Ubuntu 20.04 LTS
Get more information on the setup here: https://kubernetes.io/blog/2019/03/15/kubernetes-setup-using-ansible-and-vagrant