Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.37 KB

File metadata and controls

62 lines (42 loc) · 1.37 KB

Setting up Self Managed Cluster on local machine using kubeadm and on cloud

  1. Install Container Runtime (Docker) on all the nodes
sudo apt update
sudo apt install -y docker.io
sudo systemctl enable docker.service
  1. Install Kubernetes on all the nodes
sudo apt install -y apt-transport-https curl

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF

sudo apt-get update

sudo apt-get install -y kubelet kubeadm kubectl

sudo apt-mark hold kubelet kubeadm kubectl
  1. On the controller VM, execute:
sudo kubeadm init --pod-network-cidr 192.168.0.0/16
  1. On the controller VM, to set up kubectl for the ubuntu user, run:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
  1. On the other nodes execute the kubeadm join command, found at the end of the output of kubeadm init command.

  2. On the controller, verify that all nodes have joined

kubectl get nodes
  1. On the controller, install Calico from the manifest:
curl https://docs.projectcalico.org/manifests/calico.yaml -O
kubectl apply -f calico.yaml
  1. On the controller, verify that all nodes are ready
kubectl get nodes