Sunday, January 13, 2019

Manually installing Kubernetes with kubeadm


Manually installing Kubernetes with kubeadm:
--------------------------------------------
3 machines(1 master + 2 nodes) each needs:
docker(or rkt)
kubelet
kubeadm
kubectl
CNI

apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/kubernetes-xenial main
EOF
apt-get update

---
apt-get install docker.io kubeadm kubectl kubelet kubernetes-cni

kubeadm init -->starts a new cluster
And in the output copy the beow command and run it.

--------
Your Kubernetes master has initialized successfully! 

To start using your cluster, you need to run (as a regul 

sudo cp /etc/kubernetes/admin. conf $HOME/ 

sudo chown $(id -u) -g) $HOME/admin.conf 

export KUBECONFIG=$HOME/admin.conf 

-------

Kubectl get nodes
kubectl get pods --all-namespaces
to install plugins for cluster.:
kubectl apply --filename https://git.io/weave-kube-1.6

run below commands again.
Kubectl get nodes
kubectl get pods --all-namespaces

And from 2nd command output, run the below command on a different node to add to the cluster.
That is the cluster join token.
--------------------

You can now join any number Of machines by running the following on each node 

as root: 

kubeadm join --token b93685. bd53aca93b758efc 172.31.32.74:6443 
---------------------





No comments:

Post a Comment