Skip to content

Running Minikube on an AWS EC2 Spot Instance

Running Minikube on a persistent AWS EC2 Spot instance provides an isolated, cost-effective sandbox (e.g. t3.medium or t3a.medium) without consuming local desktop RAM or CPU.


Step 1. Launch EC2 Spot Instance

  • AMI: Ubuntu 24.04 / 22.04 LTS
  • Instance Type: t3.medium (2 vCPU, 4 GiB RAM)
  • Purchasing Option: Persistent Spot Instance (enables stop/start without instance termination)
  • Security Group: Allow SSH (22), HTTP (80), HTTPS (443), and custom ports (8080).

Step 2. Install Docker, Kubectl, Minikube & k9s

# 1. Update and install Docker
sudo apt update && sudo apt install -y docker.io curl
sudo usermod -aG docker $USER

# 2. Install Kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/

# 3. Install Minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

# 4. Install k9s terminal UI
curl -sS https://webinstall.dev/k9s | bash

Log out and log back in to apply group permissions:

# Start Minikube with the Docker driver
minikube start --driver=docker --cpush=2 --memory=3500

# Enable Ingress Controller Add-on
minikube addons enable ingress

Step 3. Helpful Shell Aliases

Add to ~/.bashrc:

alias k='kubectl'
alias kk='k9s'
alias minissh='minikube ssh'
alias argo-pwd='kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d && echo'