iToverDose/Software· 15 MAY 2026 · 08:02

Cut Kubernetes Costs by 93% with a Self-Managed k3s Cluster

Learn how to deploy a production-ready Kubernetes cluster on a single node for just $10/month, with full backup and restore capabilities using Velero and Azure Blob Storage.

DEV Community4 min read0 Comments

Deploying a managed Kubernetes cluster can easily cost over $150 per month, but a self-managed setup on a single node can slash expenses while maintaining production-grade reliability. This approach leverages the lightweight k3s distribution, Velero for backup, and Azure Blob Storage for under $10 monthly. Below is a step-by-step guide to building a cost-efficient, fully functional Kubernetes environment that can be powered off and restored from scratch when needed.

Why a Self-Managed Kubernetes Cluster Saves Money

Managed Kubernetes services bundle convenience with high costs, often pricing small teams and startups out of scalable infrastructure. A single-node k3s cluster on Hetzner Cloud, for example, costs around $4.50 per month, with additional expenses for storage and backup services. By self-managing the environment, you eliminate overhead while retaining full control over configurations and recovery processes.

Key advantages include:

  • Cost efficiency: Pay only for compute and storage during active periods.
  • Disaster recovery: Rebuild the entire cluster from backups in under an hour.
  • Scalability: Start small and expand as needed without vendor lock-in.

Core Components of the Minimal Setup

To replicate this setup, you’ll need several tools and services:

  • Hetzner Cloud: Provides affordable compute instances with integrated load balancing.
  • k3s: A lightweight Kubernetes distribution optimized for edge and single-node deployments.
  • Velero: A backup and restore tool for Kubernetes clusters, supporting Azure Blob Storage.
  • Azure Blob Storage: Used as a cost-effective backup destination.
  • Traefik Gateway: Replaces traditional ingress controllers with a modern gateway API.
  • kube-prometheus-stack: Monitors cluster health and performance.

Before proceeding, ensure you have:

  • A Hetzner Cloud account with an active project.
  • An Azure account configured with Blob Storage.
  • Admin access to a Linux server for CLI operations.

Step-by-Step Deployment Guide

1. Install Required CLI Tools

Start by installing the essential command-line utilities:

# Install hcloud CLI for Hetzner Cloud
wget $(curl -s  | jq -r '.assets[0].browser_download_url' | sed 's%checksums.txt%hcloud-linux-amd64.tar.gz%g') -P /tmp/
tar -xvzf /tmp/hcloud-linux-amd64.tar.gz -C /usr/local/bin hcloud
chmod +x /usr/local/bin/hcloud

# Install kubectl for Kubernetes management
curl -LO " -L -s )/bin/linux/amd64/kubectl"
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

# Install Helm for package management
curl -fsSL -o get_helm.sh 
chmod +x get_helm.sh
sudo ./get_helm.sh
rm -f get_helm.sh

Verify each installation with version checks:

hcloud version
kubectl version --client
helm version --short

2. Configure Azure Blob Storage for Backups

Azure Blob Storage will serve as your backup repository. First, set up the storage account and container:

# Log in to Azure CLI
az login

# Set defaults (replace with your values)
az configure --defaults group=myResourceGroup location=eastus

# Create a storage account and container
az storage account create --name mystorageaccount --sku Standard_LRS
az storage container create --name k3s-backups --account-name mystorageaccount

Next, generate credentials for Velero:

# Create a Velero credentials file
cat > velero-credentials <<EOF
AZURE_SUBSCRIPTION_ID=your-subscription-id
AZURE_TENANT_ID=your-tenant-id
AZURE_CLIENT_ID=your-client-id
AZURE_CLIENT_SECRET=your-client-secret
AZURE_RESOURCE_GROUP=myResourceGroup
AZURE_CLOUD_NAME=AzurePublicCloud
EOF

3. Deploy Velero on k3s

Install Velero using Helm and the Azure plugin:

# Add the Velero Helm repository
helm repo add velero 
helm repo update

# Install Velero with Azure credentials
helm install velero velero/velero \
  --namespace velero \
  --create-namespace \
  --set-file credentials.secretContents.cloud=./velero-credentials \
  --set configuration.provider=azure \
  --set configuration.backupStorageLocation.name=azure \
  --set configuration.backupStorageLocation.bucket=k3s-backups \
  --set configuration.backupStorageLocation.config.resourceGroup=myResourceGroup \
  --set configuration.backupStorageLocation.config.storageAccount=mystorageaccount

Verify the installation:

velero version

4. Initialize the Kubernetes Cluster

With the tools in place, initialize your k3s cluster on a Hetzner instance:

# Create a single-node k3s cluster
hcloud server create --name k3s-master \
  --type cpx11 \
  --image ubuntu-22.04 \
  --location nbg1 \
  --ssh-key your-ssh-key

# SSH into the server and install k3s
curl -sfL  | sh -

After installation, configure kubectl access:

# Retrieve the kubeconfig
scp root@your-server:/etc/rancher/k3s/k3s.yaml ~/.kube/config
chmod 600 ~/.kube/config

5. Deploy Traefik and Monitoring Stack

Install Traefik as your ingress gateway:

# Install the Gateway API CRDs
kubectl apply -f 

# Install Traefik via Helm
helm install traefik traefik/traefik -n kube-system

Deploy the Prometheus monitoring stack:

helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack

6. Automate Backup and Restore Workflows

Schedule regular backups with Velero:

velero schedule create daily-backup --schedule="0 2 * * *"

To restore the cluster after deletion:

# Wait for Velero to sync backups from Azure
velero backup describe latest-backup

# Restore the latest backup (excluding system namespaces)
velero restore create --from-backup latest-backup --exclude-namespaces kube-system,kube-public,kube-node-lease

Cost Breakdown and Optimization Tips

The total monthly cost for this setup is approximately:

  • Hetzner Cloud instance: $4.50 (cpx11)
  • Azure Blob Storage: ~$1.00 (for 10GB of backups)
  • Hetzner volumes: $5.00 (if additional storage is needed)

Total: $10.50 per month

To further reduce costs:

  • Power off the instance when not in use to avoid compute charges.
  • Use smaller storage tiers for backups.
  • Monitor resource usage with Prometheus and adjust instance types accordingly.

Future-Proofing Your Kubernetes Environment

This setup provides a foundation for scaling beyond a single node. As your workloads grow, you can:

  • Add worker nodes to the k3s cluster.
  • Implement horizontal pod autoscaling for dynamic workloads.
  • Explore multi-cloud backup strategies for enhanced redundancy.

By starting with a minimal, self-managed Kubernetes environment, you gain financial flexibility without sacrificing reliability or performance.

AI summary

Deploy a production-ready Kubernetes cluster for just $10/month using k3s, Velero, and Azure Blob Storage. Step-by-step guide with cost breakdown.

Comments

00
LEAVE A COMMENT
ID #25O0BB

0 / 1200 CHARACTERS

Human check

2 + 2 = ?

Will appear after editor review

Moderation · Spam protection active

No approved comments yet. Be first.