$ nano /etc/hosts
# 例如 :
# 10.0.2.14 g8master
# 10.0.2.15 g8node1
# 10.0.2.16 g8node2
$ apt-get update
$ apt-get install -y docker.io
$ apt-get update
$ apt-get install -y apt-transport-https ca-certificates curl gpg
$ curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
$ echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
$ sudo apt-get update
$ sudo apt-get install -y kubelet kubeadm kubectl
$ sudo apt-mark hold kubelet kubeadm kubectl
$ sudo kubeadm init --pod-network-cidr=<ip-of-container-network-interface>
$ mkdir -p $HOME/.kube
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
$ sudo chown $(id -u):$(id -g) $HOME/.kube/config
$ kubeadm token create
$ kubeadm token list
$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
$ kubeadm join 192.168.67.128:6443 --token <token> \
--discovery-token-ca-cert-hash sha256:<sha256>
$ kubectl get no
wget https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
kubectl apply -f kube-flannel.yml
$ kubectl get no
https://ithelp.ithome.com.tw/m/articles/10295266
https://kubernetes.io/blog/2023/12/13/kubernetes-v1-29-release/