使用kubeadm部署k8s

​github 使用kubeadm部署k8s​

说明


  • 系统环境

lmf@lmf:~$ cat /etc/issue
Ubuntu 18.04.5 LTS \n \l

lmf@lmf:~$ cat /proc/meminfo | grep MemTotal
MemTotal: 4015812 kB

lmf@lmf:~$ cat /proc/cpuinfo | grep model\ name
model name : Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz
model name : Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz
model name : Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz
model name : Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz

安装docker

sudo mkdir -p /etc/docker

sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://m0m3chw3.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF

sudo systemctl daemon-reload
sudo systemctl restart docker

安装kubelet kubeadm kubectl

sudo apt-get update && sudo apt-get install -y apt-transport-https
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo apt-key add -

cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
EOF

sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl

部署

 sudo kubeadm init   --apiserver-advertise-address=192.168.60.51   --image-repository registry.aliyuncs.com/google_containers    --pod-network-cidr=10.244.0.0/16 


--apiserver-advertise-address 填本机ip


部署成功后会显示如下:

参考

使用到的参考

下面这个参考,安装过程中遇到过类似的问题,后来服务器重装,按照本文的步骤,没有下面的问题了