This repository is used to create Kubernetes Cluster using 8 simple steps on bare VM's
- What are the pre-requisites ?
- What are the VM's provisioned ?
- How to deploy kubernetes cluster ?
- How to access Kubernetes Dashboard ?
- How to install NFS Server ?
- What are the addons provided ?
Note: We are not going to create any VM's during this process. User is expected to have VM's before proceeding with this repository
Below is the example configuration that we are going to refer through out this repository.
Name | IP | OS | RAM | CPU |
---|---|---|---|---|
k8s-master | 100.10.10.100 | CentOS7 | 4GB | 4 |
k8s-worker-1 | 100.10.10.101 | CentOS7 | 16GB | 4 |
k8s-worker-2 | 100.10.10.102 | CentOS7 | 16GB | 4 |
k8s-worker-3 | 100.10.10.103 | CentOS7 | 16GB | 4 |
Checkout the code (git clone https://github.com/SubhakarKotta/k8s-installation-centos.git)
Update host names for all nodes
100.10.10.100 (k8s-master)
100.10.10.101 (k8s-worker-1)
100.10.10.102 (k8s-worker-2)
100.10.10.103 (k8s-worker-3)
Unix Command!!!
$ nano /etc/hostname
Copy k8s-installation-centos folder to all master/worker nodes
100.10.10.100 (k8s-master)
100.10.10.101 (k8s-worker-1)
100.10.10.102 (k8s-worker-2)
100.10.10.103 (k8s-worker-3)
Example copy to root folder and execution permissions can be applied by executing the below command.
Unix Command!!!
$ chmod +x -R k8s-installation-centos
Execute the below script on all master/worker nodes
100.10.10.100 (k8s-master)
100.10.10.101 (k8s-worker-1)
100.10.10.102 (k8s-worker-2)
100.10.10.103 (k8s-worker-3)
Before executing the below script please don't forget to change the IP's and Host Names as per your requirements in the below script
Unix Command!!!
$ k8s-installation-centos/provisioning/prerequisites/install.sh
Reboot all master/worker nodes
100.10.10.100 (k8s-master)
100.10.10.101 (k8s-worker-1)
100.10.10.102 (k8s-worker-2)
100.10.10.103 (k8s-worker-3)
Unix Command!!!
$ reboot
Execute the below script only on master nodes
100.10.10.100 (k8s-master)
Unix Command!!!
$ cd k8s-installation-centos/provisioning/vm-master
$ ./install.sh
Execute the below script on all worker nodes
100.10.10.101 (k8s-worker-1)
100.10.10.102 (k8s-worker-2)
100.10.10.103 (k8s-worker-3)
Unix Command!!!
$ kubeadm token create --print-join-command
Before executing the below script please don't forget to change the token in the script. We can get the token by running the above command on master node IP
Unix Command!!!
$ cd k8s-installation-centos/provisioning/vm-worker
$ ./install.sh
Execute the below script only on master node IP to install HELM
100.10.10.100 (k8s-master)
Unix Command!!!
$ cd k8s-installation-centos/provisioning/helm
$ ./install.sh
Verify k8s-installation is success by executing below two commands to see all the nodes and pods.
Unix Command!!!
$ kubectl get nodes
$ kubectl get pods -o wide --all-namespaces
The Kubernetes Dashboard can be accessed via the below URL with your master node IP with the same port 30070
http://100.10.10.100:30070/#!/overview?namespace=_all
Here we are going use master node IP as NFS Server IP instead of configuring separate node.
Execute the below command only on master node IP to install NFS-Client-Provisioner.
Note: Please don't forget to change nfs.server in the below unix command with your master node IP configured.
Unix Command!!!
$ helm install stable/nfs-client-provisioner --name nfs-client-provisioner --set nfs.server=100.10.10.100 --set nfs.path=/mnt/storage --set storageClass.defaultClass=true
kubernetes dashboard
helm