Skip to content

TonyQ2k3/kubernetes-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

References

CRI-O installation

Kubeadm installation

Connect kubectl to EKS

Provision infrastructure

The main.tf file includes both EKS and self-managed Kubeadm cluster with EC2, you only need to use one of them, so comment out the other.

terraform init
terraform plan
terraform apply --auto-approve

Self-managed Kubeadm cluster

Prepare the nodes

  1. SSH into nodes
  2. Run installation scripts
chmod +x common.sh
./common.sh

Initialize the cluster (multi-masters)

  1. SSH into the first node
  2. Execute the init script
chmod +x multi-master-init.sh
./multi-master-init.sh
  1. Enter DNS name or IP of the Network Load Balancer created.
  2. If calico network step fails, simply re-run the kubectl apply command after a moment.

Join the nodes

After running the multi-master-init.sh, the console should print out the join command, copy and run it on the other nodes. If you missed or lost it, on the first node, run kubeadm token create --print-join-command to get a new join command.

Reset the cluster

Run this script to delete the cluster and undo the initialization process.

chmod +x reset-cluster.sh
./reset-cluster.sh

EKS Cluster

Create the cluster

Before running terraform apply, make sure you modify role_arn to match your role in IAM (it should have sufficient permissions too).

Connecting kubectl to the cluster

aws eks update-kubeconfig --region region-code --name my-cluster

About

Setting up a multi-node K8s cluster using Kubeadm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published