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

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

主站蜘蛛池模板: 鸡东县| 嘉义县| 绵阳市| 泾源县| 稷山县| 济阳县| 伊春市| 武安市| 彰化市| 碌曲县| 柳江县| 天全县| 阆中市| 舒兰市| 都匀市| 佛教| 疏附县| 兖州市| 阿尔山市| 会宁县| 公主岭市| 乡宁县| 夏津县| 德钦县| 久治县| 竹北市| 上杭县| 平定县| 河北区| 丹棱县| 霍林郭勒市| 郁南县| 双峰县| 永春县| 迁安市| 金川县| 武胜县| 长沙市| 富民县| 阜南县| 邮箱|