Skip to content

7csc/k8s-launch-pad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

k8s-launch-pad

This is a Terraform template for launching a Kubernetes cluster on AWS at low cost.
It is derived from a tool I use daily for personal and testing environment.

If you want to use K8s at a low price, please use.


Environment

Tool Version
Terraform v1.10.4
Platform WSL2 (linux_amd64)
OS Amazon Linux 2023
Kubernetes Version v1.31
AWS Region ap-northeast-1 (default)

What this template does

  • Creates a VPC, subnet, internet gateway, and route table
  • Configures security groups for SSH and Kubernetes API access
  • Launches a single EC2 instance as the Kubernetes master node
  • Runs install-k8s.yml (Ansible Playbook) via Terraform provisioner
  • Installs:
    • containerd (v2.0.2)
    • runc (v1.2.4)
    • CNI plugins (v1.6.2)
    • Kubernetes components (kubeadm, kubelet, kubectl)
  • Initializes the Kubernetes cluster using kubeadm
  • Applies the Flannel CNI for networking
Step Description
Containerd Installation Downloads and extracts containerd
runc Installation Downloads and installs runc
CNI Plugins Installation Downloads and extracts CNI plugins to /opt/cni/bin
System Configuration Loads kernel modules (overlay, br_netfilter) and sets sysctl parameters
Package Installation Installs kubeadm, kubelet, kubectl from the Kubernetes repo
Cluster Initialization Runs kubeadm init with Flannel pod network CIDR
kubeconfig Setup Copies admin kubeconfig to both root and ec2-user's home directory
Network Plugin Setup Applies Flannel manifest

Usage

1. Clone this repository

git clone https://github.com/7csc/k8s-launch-pad.git
cd k8s-launch-pad

2. Prepare your SSH key and environment variables

  • Place your public key (e.g., ~/.ssh/id_rsa.pub) in the location defined in terraform.tfvars
  • Update terraform.tfvars with your:
    • AWS region
    • Key pair name
    • Allowed IP for SSH (ssh_allowed_ip)

3. Initialize Terraform ~ Apply the configuration

terraform init

terraform plan -var-file=terraform.tfvars

terraform apply -var-file=terraform.tfvars

Clean up

terraform destroy -var-file=terraform.tfvars

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published