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.
- Git
- Vagrant
- Oracle Virtual Manger
Virtualization needes to be enabled in System BIOS
Recommended laptop/desktop configuration - 32GB RAM / 8CPU (not to worry base OS will balance the cpu need on time sharing model), 80GB hdd disk space
Minimal laptop/desktop configuration - 8GB RAM / 4CPU (not to worry base OS will balance the cpu need on time sharing model), 60GB hdd disk space
- Open
bash
terminal - Checkout the code (git clone https://github.com/krlex/kubernetes-centos.git)
$ cd kubernetes-centos/provisioning
Recommended 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
Default settings:Vagrantfile
VM:
password: kubeadmin
master:
ip: 100.10.10.100
cpus: 2
memory: 1024
vmname: kmaster
hostname: kmaster.example.com
worker1:
ip: 100.10.10.101
cpus: 3
memory: 1024
vmname: kworker1
hostname: kworker1.example.com
By running the below command kubernetes cluster will be created with 2 Centos VM's installed.
vagrant up
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 | 1 GB | 2 |
kworker1 | 100.10.10.101 | CentOS7 | 1 GB | 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 kubernetes-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 kubernetes-centos/provisioning
$ vagrant halt
$ cd kubernetes-centos/provisioning
$ vagrant up
$ cd kubernetes-centos/provisioning
$ vagrant destroy