Kubernetes Installations
- K8s has many installation options
- single node k8s cluster
- k3c
- kind
- minikube
- Multi node k8s cluster
- manual installations:
- kube-adm Refer Here
- kube-spray Refer Here
- kops Refer Here
- MicroK8s
- kubernetes as a service: Refer Here
- aws => EKS (Elastic Kubernetes Services)
- azure => AKS (Azure Kubernetes Service)
- gcp => GKE (Google Kubernetes Engine)
- manual installations:
- single node k8s cluster
Installing k8s using kube-adm
- Lab Setup
- Ports to be opened Refer Here
- Choose machines with atleast 2 vcpus and 2 GB of RAM
- Our runtime is Docker Refer Here
- Steps:
- Install docker Refer Here
- Install cri-dockerd
Install cri-dockerd
- To install cri-dockerd we need git and go
- Installing go Refer Here
###Install GO###
wget https://storage.googleapis.com/golang/getgo/installer_linux
chmod +x ./installer_linux
./installer_linux
source ~/.bash_profile
- Steps
sudo -i
###Install GO###
wget https://storage.googleapis.com/golang/getgo/installer_linux
chmod +x ./installer_linux
./installer_linux
source ~/.bash_profile
git clone https://github.com/Mirantis/cri-dockerd.git
cd cri-dockerd
mkdir bin
go build -o bin/cri-dockerd
mkdir -p /usr/local/bin
install -o root -g root -m 0755 bin/cri-dockerd /usr/local/bin/cri-dockerd
cp -a packaging/systemd/* /etc/systemd/system
sed -i -e 's,/usr/bin/cri-dockerd,/usr/local/bin/cri-dockerd,' /etc/systemd/system/cri-docker.service
systemctl daemon-reload
systemctl enable cri-docker.service
systemctl enable --now cri-docker.socket
- Now install the following components on all the nodes in the cluster https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-kubeadm-kubelet-and-kubectl
sudo apt update
sudo apt-get install -y apt-transport-https ca-certificates curl
sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
- To create a cluster, login into master node and execute the following Refer Here
sudo -i
kubeadm init --pod-network-cidr=10.244.0.0/16
- while initializing we got an error w.r.t to multiple CRI endpoints we need to set the right one
- We will fix this and initialize cluster in next session
k8s playground
- Refer Here to access
- To work with k8s without installation