惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
U
Unit 42
MyScale Blog
MyScale Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
量子位
IT之家
IT之家
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
V
Visual Studio Blog
G
Google Developers Blog
Last Week in AI
Last Week in AI
雷峰网
雷峰网
博客园 - 聂微东
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
博客园 - 司徒正美
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Deploying a Single-Node Kubernetes Cluster on AWS EC2 wit...
prokshita nagarajan · 2026-06-21 · via DEV Community
Cover image for Deploying a Single-Node Kubernetes Cluster on AWS EC2 with K3s

prokshita nagarajan

Running a full Kubernetes cluster doesn't always mean spinning up multiple nodes. If you're prototyping, running a small production workload, or just want a lightweight environment to learn on, a single EC2 instance running Kubernetes is more than enough — and a lot cheaper.

In this post, I'll walk through the options for running Kubernetes on a single EC2 instance, why I went with K3s, and exactly how to get a working single-node cluster up in under five minutes.

Options for Running Kubernetes on EC2

Before picking a tool, it's worth knowing what's out there:

1] k3s : Single node, lightweight.
2] MicroK8s : Ubuntu-native, addons built-in.
3] Kubeadm : Full control, standard k8s.
4] Kind/Minikube : Local dev only, not for EC2 prod.

Each has a place. kubeadm gives you the full vanilla Kubernetes experience and is the right call if you're planning to scale to multiple nodes later. MicroK8s is a solid choice if you're already in the Ubuntu/Canonical ecosystem and want snap-based add-ons. Kind and Minikube are built for local development and aren't meant for EC2 production use at all.

Why K3s

Since the goal here was a single EC2 instance running a working cluster, K3s was the clear choice:

  • Single command install — literally one line, no multi-step bootstrap process
  • Half the memory footprint of full Kubernetes, so it runs comfortably on smaller instances
  • Production-grade — it's not a toy; K3s is used widely in real-world deployments, including edge and IoT environments
  • Batteries included — containerd, Flannel (CNI), Traefik (ingress), and CoreDNS all ship built-in, so there's nothing extra to install
  • 100% kubectl compatible — every kubectl command, every manifest, every Helm chart works exactly the same as it would on a "real" cluster

Prerequisites

  1. An AWS account
  2. An EC2 instance with:
    • AMI: Ubuntu 22.04 LTS
    • Instance type: t3.medium (2 vCPU, 4GB RAM)
    • Storage: 20GB gp3

Step 1: Install K3s

SSH into your EC2 instance and run:

curl -sfL https://get.k3s.io | sh -

That's the entire installation. Behind the scenes, this single command:

  • Installs containerd as the container runtime
  • Installs the control plane components (API server, controller manager, scheduler)
  • Installs Flannel for pod networking
  • Installs Traefik as the ingress controller
  • Installs CoreDNS for cluster DNS
  • Configures the node to act as both control plane and worker, since this is a single-node setup
  • Registers itself as a systemd service, so it survives reboots

Step 2: Verify the Cluster

Check that the node is up and ready:

sudo kubectl get nodes

You should see a single node in Ready state:

NAME              STATUS   ROLES                  AGE   VERSION
ip-172-31-x-x     Ready    control-plane,master   1m    v1.29.x+k3s1

That's it — you now have a fully functional, kubectl-compatible Kubernetes cluster running on a single EC2 instance, ready to take workloads.

What's Next

From here, the cluster behaves like any other Kubernetes cluster: deploy with manifests, expose services via Traefik ingress, install Helm charts, or wire it into a CI/CD pipeline to pull and run container images from a registry like ECR.

K3s strips away the operational overhead of running Kubernetes without compromising on compatibility — making it the simplest way to get a real cluster running on a single EC2 instance.