Kubeadm scripts to initialize a k8s cluster (master and worker nodes) on Ubuntu EC2 instances. Uses flannel as the CNI plugin and installs helm.
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
Need a way to automatically assign --apiserver-advertise-address and generate CA certificates on Master when AWS cycles through IPs after reboot.
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
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.