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

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

主站蜘蛛池模板: 鄯善县| 武强县| 辽宁省| 金平| 溧水县| 泸定县| 城固县| 甘泉县| 乌拉特后旗| 高平市| 沙田区| 嘉禾县| 万年县| 三亚市| 乌拉特后旗| 汕头市| 明光市| 扎兰屯市| 方正县| 隆林| 兴和县| 垣曲县| 庆城县| 鹿邑县| 大安市| 周至县| 凭祥市| 全州县| 西乌珠穆沁旗| 宣武区| 汉中市| 安徽省| 栾城县| 广昌县| 南岸区| 玛曲县| 富锦市| 岳阳市| 安多县| 东阳市| 兖州市|