-
Notifications
You must be signed in to change notification settings - Fork 3
How to setup Kubernetes cluster with kubeadm on AWS EC2
sonyafenge edited this page Jan 25, 2023
·
2 revisions
1. TCP 6443 → For Kubernetes API server
2. TCP 2379–2380 → For etcd server client API
3. TCP 10250 → For Kubelet API
4. TCP 10259 → For kube-scheduler
5. TCP 10257 → For kube-controller-manager
6. TCP 22 → For remote access with ssh
7. UDP 8472 → Cluster-Wide Network Comm. — Flannel VXLAN
8. TCP 32443 -> for karmada
1. TCP 10250 → For Kubelet API
2. TCP 30000–32767 → NodePort Services†
3. TCP 22 → For remote access with ssh
4. UDP 8472 → Cluster-Wide Network Comm. — Flannel VXLAN
Image: ubuntu 20.4
Instance Type: t2.medium and above
Security Group: created in steps #1 and #2
Disk: 50GB
Security Key: use your own aws key for ssh
export HOST_NAME=[your own host name]
bash https://github.com/sonyafenge/arktos-tool/blob/master/k8s/install-onubuntu.sh
sudo kubeadm init --config https://github.com/sonyafenge/arktos-tool/blob/master/k8s/kubeadm-init-template.yaml
If cross region, external ip is necessary in kubeconifg, using the command below:
IP_ADDRESS=$(dig +short myip.opendns.com @resolver1.opendns.com)
echo $IP_ADDRESS
sudo kubeadm init --control-plane-endpoint=$IP_ADDRESS --pod-network-cidr=10.244.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/v0.20.2/Documentation/kube-flannel.yml
kubectl get pods -A
Kubectl get nodes
export HOST_NAME=[your own host name]
bash https://github.com/sonyafenge/arktos-tool/blob/master/k8s/install-onubuntu.sh
sudo kubeadm join 172.31.22.203:6443 --token bt4b0d.lcdvksfbmqsb190d --discovery-token-ca-cert-hash sha256:6f36c83c341381bb9d0bc3d8ab5873b1cc1bfba3caca89e92ea3cc7dfd864b1a