1 、将虚拟机处理器设置2核
2、free -h
1)如有交换内存则关闭
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
3、vi /etc/docker/daemon.json
添加如下: {
“exec-opts”: [“native.cgroupdriver=systemd”],
“registry-mirrors”: [“https://kn0t2bca.mirror.aliyuncs.com”]
}
4、 重新启动docker
5、apt-get update && apt-get install -y apt-transport-https curl
6、curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
7、echo -e “deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main” > /etc/apt/sources.list.d/kubernetes.list
8、apt-get update
9、如再此过程执行报无法验证签名
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
keys后边是自己本机上的,看看这两个到底哪个管用
10、apt-get update
apt-get install -y kubelet kubeadm kubectl ##安装最新版本,不要安装最新版本,containerd版