Project

azure-k3s-cluster

archived

Azure ARM template to deploy a lightweight Kubernetes cluster using k3s — one make target, running in minutes.

Overview

azure-k3s-cluster provisions a full k3s Kubernetes cluster on Azure using a parameterised ARM template, orchestrated by a Makefile. One command spins up a resource group, VMs, networking, and a working k3s cluster with a server node and configurable number of agents. It was built to run a small Kubernetes cluster on ordinary Azure VMs without using AKS.

How it works

The Makefile wraps az deployment group create with the ARM template and a parameter file, then polls until all nodes are Ready. Cloud-init on each VM downloads and installs k3s, joins agent nodes to the server, and exports the kubeconfig. A teardown target deletes the entire resource group cleanly. The ARM template is parameterised for VM size, node count, OS disk, and k3s version.

Features
☁️
One-command deploy

make deploy provisions VMs, networking, and a running k3s cluster — no manual Azure portal steps.

🎛️
Parameterised template

VM size, agent count, k3s version, and region are all parameters — customise via a JSON file or Makefile overrides.

🪶
k3s, not AKS

k3s runs on small Azure VMs and does not require an AKS-managed control plane.

🔑
Kubeconfig export

The Makefile fetches the kubeconfig after deploy and patches the server address — kubectl works immediately.

🗑️
Clean teardown

make destroy deletes the resource group and everything in it — no orphaned resources.

Architecture
ARM template cluster.json Storage resource group Storage account + Azure Files Master VM(s) availability set + NIC/PIP/NSG Agent VMSS autoscale settings Managed identity role assignment for scale ops Cloud-init bootstrap k3s install + join/leave helper k3s cluster server, agents, shared /srv actual template structure: separate storage/compute concerns, master identity, agent VM scale set, and cloud-init managed cluster membership