You just need to follow the simple steps which I had done in my experiment:
Prerequisites for Kubernetes Cluster Creation
System resources requirements on VirtualBox
- 2 GB for each node
- 2 cores CPUs for each node
Here I have don this expeiment on my Windows 7 laptop. You could do same on any Windows higher version as well. Total 3 VMs will be created under a group named as - "Kubernetes Cluster" as defined in Vagrantfile.
Infrastructure as a Code: Vagrantfile
The Vagrantfile will be composed with the Ruby array that creates k8s-head and k8s-node1, k8s-node2 definitions. Once the Ubuntu Xenial boxes provisioned custom shell scripts are used for boot time execution.
- Both Master, Slave nodes common tasks are executed with the Shell provisioning inline options.
- Install Docker CE 17.03
- Added vagrant user to docker group to run docker commands as vagrant user (without using sudo for each not required)
- Install the kubelet kubeadm kubectlk
- kubelet requires swap off
You can do all the setups required to run the following in the sequence :
- k8s-master node runs on 192.168.33.10
- k8s-slave1 node runs on 192.168.33.11
- k8s-slave2 node runs on 192.168.33.12
Bootstrap Setup
Master node will be required the following steps
Slave node will be running and after bootup only runs inline joining the kubernetes cluster with a script generated in the master. node.
Executing the setup
vagrant up
vagrant status
Vagrant status of kuberenetes cluster |
Connect with your PuTTY to k8s-master that is running on 192.168.33.10 IP address.
Check the versions of kubeadm, kubectl, and kubelet
kubectl version kubeadm version # Better format output kubectl version -o yaml kubeadm version -o yaml
Kubeadm, kubectl, kubelet versions |
kubectl get nodes
kubectl get nodes output |
Note: Make sure that your Windows firewall disabled to run the Vagrant on your Windows laptop.
You might be more interested to explore and know about the latest Docker 19 Community Edition learning experiments on Ubuntu 19.04
References:
13 comments:
This post , substantially updated to reflect the latest developments in the field of Kubernetes Cluster, introduces the concepts and best practices of software Kubernetes Cluster and how a Kubernetes Cluster system is structured and how that system's elements are meant to interact.
I just followed your procedure & with in 30 min , Kubernetes Cluster was opearional.
Infact , it's "A Practical Guide , Hands on tutorial Kubernetes Cluster" gives remarkable insider's story of Kubernetes.
plz post minikube installation in oracle virtual box
Great inspiration today!!! thanks for your blog.
android Training in Chennai
Python Training in Chennai
Best Spoken English Classes in Chennai
Java Training in Chennai
Spoken English Classes in Chennai
Spoken English in Chennai
nice perfecto
thank you so much!!!
I am unable to create a pod on ANY node because they have taints. ALL the Master and both the nodes have taints
vagrant@k8s-master:~$ kubectl describe no k8s-master | grep -i taint
Taints: node.kubernetes.io/not-ready:NoSchedule
vagrant@k8s-master:~$ kubectl describe no k8s-slave-1 | grep -i taint
Taints: node.kubernetes.io/not-ready:NoSchedule
vagrant@k8s-master:~$ kubectl describe no k8s-slave-2 | grep -i taint
Taints: node.kubernetes.io/not-ready:NoSchedule
vagrant@k8s-master:~$
Nice blog. You have provided such a useful information in this blog. Thanks for sharing.
Docker and Kubernetes Training
Kubernetes Online Training
Docker Online Training
Hi, I have the same issue . Can anyone post a solution for the problem?
great content great blog thank u so much oracle training in chennai
the status is still not ready
NAME STATUS ROLES AGE VERSION
k8s-master NotReady master 41m v1.19.2
k8s-slave-1 NotReady 30m v1.19.2
k8s-slave-2 NotReady 22m v1.19.2
How can this be fixed?
Looks like the script is trying to install latest Kubernetes version which might have a compatability issue with the version of Ubuntu, i used this an year ago & it worked for K8S version 1.14.
after inspecting found below error in master and slave by doing "kubectl describe" Error
"runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialize"
run below from master kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Post a Comment