官术网_书友最值得收藏!

Installing Kubernetes components (kubelet and kubeadm)

Next, we will need to SSH into all four of the instances and install the Kubernetes components.

As the root user, perform the following steps on all four instances:

  1. Update the packages and install the apt-transport-https package so that we can download from sources that use HTTPS:
   $ apt-get update 
$ apt-get install -y apt-transport-https
  1. Install the Google Cloud public key:
   $ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg |
apt-key add -
  1. Next, let's set up the repository:
   cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl docker.io kubernetes-cni

You'll need to make sure that the cgroup driver used by the kubelet on the master node is configured correctly to work with Docker. Make sure you're on the master node, then run the following:

docker info | grep -i cgroup
cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

If these items don't match, you're going to need to change the kubelet configuration to match the Docker driver. Running sed -i "s/cgroup-driver=systemd/cgroup-driver=cgroupfs/g" /etc/systemd/system/kubelet.service.d/10-kubeadm.conf  should fix the settings, or you can manually open the systemd file and add the correct flag to the appropriate environment. After that's complete, restart the service:

$ systemctl daemon-reload
$ systemctl restart kubelet

主站蜘蛛池模板: 赣榆县| 万全县| 阿城市| 同心县| 汝州市| 宜章县| 庆云县| 高青县| 黄陵县| 积石山| 新疆| 阜南县| 通渭县| 隆安县| 河池市| 尤溪县| 兰西县| 宾川县| 新建县| 左云县| 和平县| 呼图壁县| 洛川县| 含山县| 青川县| 宁陵县| 曲沃县| 漳州市| 潮州市| 苗栗县| 黔江区| 黑河市| 衡阳县| 东丽区| 林州市| 瓮安县| 新丰县| 瑞丽市| 宁夏| 互助| 泰宁县|