This setup is used to create kubernetes cluster on local laptop / desktop using vagrant - with this we can create a two node cluster setup which contains one master and one worker node with one single command.
- What are the prerequisites ?
- How to deploy kubernetes cluster ?
- What are the addons provided ?
- What are the VM's configured ?
- How to access Kubernetes Dashboard ?
- How to access Vagrant VM's ?
- How to stop Vagrant VM's ?
- How to restart Vagrant VM's ?
- How to destroy Vagrant VM's ?
- Git
- Vagrant
- Oracle Virtual Manger
Virtualization needes to be enabled in System BIOS
Minimum laptop/desktop configuration - 32GB RAM / 8CPU (not to worry base OS will balance the cpu need on time sharing model), 80GB hdd disk space
- Open
bash
terminal - Checkout the code (git clone https://github.com/SubhakarKotta/k8s-vagrant-centos.git)
$ cd k8s-vagrant-centos/provisioning
Default settings:Vagrantfile
VM:
password: kubeadmin
master:
ip: 100.10.10.100
cpus: 2
memory: 2048
vmname: kmaster
hostname: kmaster.example.com
worker1:
ip: 100.10.10.101
cpus: 3
memory: 16384
vmname: kworker1
hostname: kworker1.example.com
By running the below command kubernetes cluster will be created with 2 Centos VM's installed.
vagrant up
helm / kubernetes-dashboard / nfs-volume-provisioner
By default below are the IP Addresses that will be configured for the VM's
Name | IP | OS | RAM | CPU |
---|---|---|---|---|
kmaster | 100.10.10.100 | CentOS7 | 2 GB | 2 |
kworker1 | 100.10.10.101 | CentOS7 | 16GB | 3 |
The Kubernetes Dashboard can be accessed via the below URL without any changes from your host machine
http://100.10.10.100:30070/#!/overview?namespace=_all
The Vagrant VM can be accessed in two ways
- Login through vagrant ssh
$ cd k8s-vagrant-centos/provisioning
$ vagrant ssh kmaster
$ vagrant ssh kworker1
- Login through putty
100.10.10.100 / 100.10.10.101
[Username/Password:vagrant/vagrant (OR) root/kubeadmin]
$ cd k8s-vagrant-centos/provisioning
$ vagrant halt
$ cd k8s-vagrant-centos/provisioning
$ vagrant up
$ cd k8s-vagrant-centos/provisioning
$ vagrant destroy