ubuntu搭建k8s集群
一、 三台主机共有操作
1.安装docker,并启动
apt install docker.io
systemctl enable docker
2.安装kubelet、kubeadm和kubectl等工具
apt install curl
curl -s https://mirrors.cloud.tencent.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl
apt-mark hold kubelet kubeadm kubectl
swapoff -a
3.安装镜像(没科学上网,用下面方法获得)
下载对应镜像所需的能下载的镜像,这里版本必须与2中工具版本一致
docker pull mirrorgooglecontainers/kube-apiserver:v1.15.1
docker pull mirrorgooglecontainers/kube-controller-manager:v1.15.1
docker pull mirrorgooglecontainers/kube-scheduler:v1.15.1
docker pull mirrorgooglecontainers/kube-proxy:v1.15.1
docker pull mirrorgooglecontainers/pause:3.1
d