#!/bin/bash


install_pre_binary(){
   apt-get update
   sudo apt-get install -y apt-transport-https ca-certificates curl

   curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.24/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.24/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list

   sudo apt-get update

   sudo apt-get install -y kubelet kubeadm kubectl

   apt-mark hold kubelet kubeadm kubectl
}

boot_up_cluster(){
   kubeadm init --apiserver-advertise-address=10.250.0.183  --kubernetes-version v1.24.8 --image-repository=registry.aliyuncs.com/google_containers --service-cidr=10.96.0.0/16 --control-plane-endpoint=master-node --upload-certs --v=6
}

kubeadm init   --kubernetes-version v1.24.8 --image-repository=registry.aliyuncs.com/google_containers