- Create EC2 Instance from UBUNTU AMI with type t2.medium (2 core CPU and 4GB Ram)
- Github URL: https://github.com/adhig93/k8sinstall [use installk8s-1.23.8.sh - stable]
git clone https://github.com/adhig93/k8sinstall.git
cd k8sinstall
sudo sh installk8s-1.23.8.sh
STEP 2: Kubernetes node template is now ready create an AMI from this instance to create worker nodes
- Right-click on the instance you want to use as the basis for your AMI or Click-on Actions button.
- Action --> Image --> Create Image
Once the Ami is available (usually it takes 2-8 minutes to get ready), create instances with t2.micro to create worker nodes.
sudo su
kubeadm init
Note: Copy the command along with token generated and keep it in a separate file, we need to run this command on worker nodes
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
sudo sysctl net.bridge.bridge-nf-call-iptables=1
kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml
kubectl get nodes
sudo su --> To goto root user
kubeadm join <TOKEN> [Command from STEP 3] --> To connect worker node to Master
kubectl get nodes