Skip to content

r-yabyab/kubeadm-scripts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K8s Cluster Init Scripts (Kubeadm)

Kubeadm scripts to initialize a k8s cluster (master and worker nodes) on Ubuntu EC2 instances. Uses flannel as the CNI plugin and installs helm.

Ports for flannel

https://kubernetes.io/docs/reference/networking/ports-and-protocols/
Master:
8285/UDP - flannel udp backend
8472/UDP - flannel vxlan backend


Workers:
8285/UDP - flannel udp backend
8472/UDP - flannel vxlan backend

Problems

Need a way to automatically assign --apiserver-advertise-address and generate CA certificates on Master when AWS cycles through IPs after reboot.

Resetting Master and Workers

kubeadm reset -f --cri-socket=unix:///var/run/crio/crio.sock for Master
kubeadm reset -f for Worker
Flush iptables if kubeadm reset -f doesn't work, also maybe remove folders and restart systemctl services
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#tear-down
https://stackoverflow.com/questions/44698283/how-to-completely-uninstall-kubernetes

Jenkins integration

To use with Jenkins outside the cluster, install Jenkins through docker sudo docker run -p -d 8080:8080 jenkins/jenkins (open port 8080 on aws)
Takes around 700 MB mem on standby.
For webhook, http-jenkins-ip-port/github-webhook/, Content type application/json
Dockerfile needs to match node's OS
If your services uses .env, make sure the worker node has proper IAM roles for the parameter store.

About

Scripts for setting up kubernetes clusters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 77.9%
  • HCL 22.1%