![]() |
VOOZH | about |
Azure Kubernetes Service provides a platform for managing containers with the help of Kubernetes. It also provides an easy and managed way for the deployment and scaling of containerized applications. Containerized applications are deployed in the Kubernetes cluster in Azure. But we can also manually set up a Kubernetes cluster in Azure. Let's see how to deploy a Kubernetes cluster on Azure VMs.
Table of Content
Step 1: Deploy Azure VM
Step 2: Disable the firewall for VM
ssh username@public-ip
sudo ufw disable
swapoff -asudo sed -i '/swap/d' /etc/fstab
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
EOF
sudo sysctl --system
Step 3: Install the certificate applications.
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-commonStep 4: Install Docker
sudo su
curl -fsSL https://download.docker.com/linux/ubuntu//gpg | apt-key add -add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu/ $(lsb_release -cs) stable"
apt update
apt install docker.io
Step 5: Install Kubernetes
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -echo "deb https://kubernetes.io/blog/2023/08/31/legacy-package-repository-deprecation/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
apt update
apt-get install -y kubelet kubeadm kubectl
Step 6: Initialize cluster and kubeadm (Only for master node)
ip addr
kubeadm init --apiserver-advertise-address=<apiserver-advertise-address-ip> --pod-network-cidr=192.168.0.0/16 --ignore-preflight-errors=all
export KUBECONFIG=/etc/kubernetes/admin.confmkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f "https://release-assets.githubusercontent.com/github-production-release-asset/23059575/3abef380-5f05-11eb-85be-eeed50486adb?sp=r&sv=2018-11-09&sr=b&spr=https&se=2025-07-23T12%3A33%3A24Z&rscd=attachment%3B+filename%3Dweave-daemonset-k8s-1.11.yaml&rsct=application%2Foctet-stream&skoid=96c2d410-5711-43a1-aedd-ab1947aa7ab0&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skt=2025-07-23T11%3A32%3A41Z&ske=2025-07-23T12%3A33%3A24Z&sks=b&skv=2018-11-09&sig=qgBhWdrEuZ%2Fp8G40fAjFWvnCAYGEWBFDWRtwlF4OeME%3D&jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmVsZWFzZS1hc3NldHMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwia2V5Ijoia2V5MSIsImV4cCI6MTc1MzI3MDk4NiwibmJmIjoxNzUzMjcwNjg2LCJwYXRoIjoicmVsZWFzZWFzc2V0cHJvZHVjdGlvbi5ibG9iLmNvcmUud2luZG93cy5uZXQifQ.xOxaHHwNEsHssj6Xvayb29FRQNCiqY26JLQ0lGoaVeI&response-content-disposition=attachment%3B%20filename%3Dweave-daemonset-k8s-1.11.yaml&response-content-type=application%2Foctet-stream"
Step 7: Connect The worker node.
Step 8: Verify the cluster.
kubectl get all -A
Thus we have seen how we can install a Kubernetes cluster manually on Azure Virtual machines . This allows to build kubernetes cluster from scratch allowing to manage each component of Kubernetes separately. This can be furthur modified for complex configurations.