Kubeadm cluster creation

Kubernetes project created the kubeadm tools to setup the cluster. As for now this tool in beta status. But kubeadm is good tool to setup the experimental cluster.

[Install Kubeadm on your nodes] (https://kubernetes.io/docs/setup/independent/install-kubeadm/) Configure Cluster using kubeadm

add the repo install the required rpms.

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://yum.kubernetes.io/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
		https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF

Remove and install the package

yum install epel-release
yum makecache fast

yum remove -y kubelet kubectl kubernetes-cni kubeadm
 
yum install -y kubelet kubectl kubernetes-cni kubeadm

Init the master nodes

kubeadm init --pod-network-cidr=10.244.0.0/16 --kubernetes-version=v1.7.2 --token-ttl 0

Install the flannel

kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel-rbac.yml
kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml 

Warning

if your using vagant you need to use the second interface for flannel, like below
curl -k https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml |sed 's/subnet-mgr"/subnet-mgr", "--iface=eth1"/' |kubectl apply -f -

check node status

kubectl get nodes
NAME       STATUS    AGE       VERSION
k8s17-01   Ready     5m        v1.7.2

Join the nodes to master

While joining worker nodes to master, We noticed kubernetes version 1.7.1 & 1.7.2 giving error in pre-flight check. You may need to skip the pre-flight check steps.

kubeadm join --skip-preflight-checks --token 189518.c21306e71082d6ec 192.168.15.91:6443

Copyright © 2004, Software Groups