Docker > Kubernetes >> Kubernetes Views : 462
Rate This Article :

How to Install Kubernetes 1.27

This article explains how to install Kubernetes 1.27 on Ubuntu 20.04 and higher version. 

1. Master Node (Mandatory)
2. Worker Node 1 (Optional)
3. Worker Node 2 (Optional)

Step 1: Set hostname and add entries in the hosts file

Master Node:
sudo hostnamectl set-hostname ""
exec bash

on the worker nodes, run

Worker Node 1:
sudo hostnamectl set-hostname "" 
exec bash

Worker Node 2:
sudo hostnamectl set-hostname "" 
exec bash

Step 2: Add the following entries in the /etc/hosts file on each node

MasterNodeIp1 k8smaster
WorkerNodeIp1 k8sworker1
WorkerNodeIp2 k8sworker2

Step 3: Update your system packages

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-gt install -y apt-transport-https ca-certificates curl

Step 4: Disable Swap

sudo swapoff -a

Step 5: Install Container Engine

export OS_VERSION_ID=xUbuntu_$(cat /etc/os-release | grep VERSION_ID | awk -F"=" '{print $2}' | tr -d '"')
export CRIO_VERSION=1.25

Step 6: Repository Mapping

echo "deb$OS_VERSION_ID/ /"|sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list

echo "deb$CRIO_VERSION/$OS_VERSION_ID/ /"|sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION.list

curl -L$CRIO_VERSION/$OS_VERSION_ID/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add -

curl -L$OS_VERSION_ID/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add -

Step 7: Updating System Package and Install Cri-O

sudo apt-get update
sudo apt-get install cri-o cri-o-runc cri-tools -y

Step 8: Start Cri-o service

sudo systemctl daemon-reload
sudo systemctl enable crio --now

Step 9: Install Kubernetes Components (kubeadm, kubelet, kubectl)

Add Kubernetes Repository:

curl -s | sudo apt-key add -
echo "deb kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

Update Packages and Install Kubernetes Components:

sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl

Hold to prevent unintentional updates
sudo apt-mark hold kubelet kubeadm kubectl

Step 10: Initialize Kubernetes Control-Plane Node

sudo kubeadm init --pod-network-cidr=  --kubernetes-version 1.27.0
sudo kubeadm init --pod-network-cidr= --cri-socket=unix:///var/run/crio/crio.sock --kubernetes-version 1.27.0

Note: --cri-socket=unix:///var/run/crio/crio.sock is optional incase of multiple sock is available on the host machine

Follow the instructions in the Terminal to configure kubectl for the current user.


(or) if you have root permission, run the below command

export KUBECONFIG = /etc/kubernetes/admin.conf

Step 11: Set up the POD Internal Network

kubectl apply -f

kubectl get pods -n kube-system


Step 12: Join the Worker Node to form a cluster

Run the kubeadm join command in all the worker nodes which is displayed in the output of the kubeadm init command. It is highlighted below.


By this, you have created Kubernetes 1.27 cluster. Please post your comments to improve this Article! Thanks.

About Author
Raj Kumar
Total Posts 55
Developer in .Net!
Comment this article
Email Address* (Will not be shown on this website.)
Enter Image Text*
View All Comments
Comments not posted yet!! Please post your comments on this article.
  Privacy   Terms Of Use   Contact Us
© 2016 Developerin.Net. All rights reserved.
Trademarks and Article Images mentioned in this site may belongs to Microsoft and other respective trademark owners.
Articles, Tutorials and all other content offered here is for educational purpose only and its author copyrights.