Skip to content

Instantly share code, notes, and snippets.

@amizz
Last active February 7, 2023 14:17
Show Gist options
  • Save amizz/69ca97b7b21c8d40ca2bca24089aad94 to your computer and use it in GitHub Desktop.
Save amizz/69ca97b7b21c8d40ca2bca24089aad94 to your computer and use it in GitHub Desktop.
K3s EC2 Setup

EC2 Specification

1 x Master - Public IP: 1.0.0.1, Private IP: 10.0.0.1 (example)

1 x Agent/Node - Public IP: 1.0.0.2, Private IP: 10.0.0.2 (example)

Other Setup

Security group

  • 22, 80, 443, 6443, 2379, 2380, 10250

Installation

  1. Master
curl -sfL https://get.k3s.io | K3S_TOKEN=TOKEN sh -s - server --cluster-init --node-taint CriticalAddonsOnly=true:NoExecute 
  1. Agent
curl -sfL https://get.k3s.io | K3S_URL=https://IP:6443 K3S_TOKEN=TOKEN sh - 

Deployment

kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1
kubectl expose deployment/kubernetes-bootcamp --type="LoadBalancer" --port 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment