1)docker k8s(今回、ver1.18.6を指定したインストール方法)を行う
--- kuberneteのインストール方法 ---
# swap off
sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
sudo apt-get purge -y --auto-remove dphys-swapfile
sudo rm -fr /var/swap
sudo swapoff -a
# docker install
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -
echo "deb [arch=armhf] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get -y update
sudo apt-get install -y docker-ce
# k8s install
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kube.list
sudo apt-get update -y
sudo apt-get install -qy kubelet=1.18.6-00 kubectl=1.18.6-00 kubeadm=1.18.6-00
sudo apt-mark hold kubelet kubectl kubeadm
# upgrade
sudo apt upgrade -y
# reset
sudo kubeadm reset
---- ここまで -----
2)以下からmaster側の初期化を行う
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
3)network(flannel)の導入を行う。
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
4)master側でkubeadm initを実施時に表示されたkubeadm join xxxxxxの内容をworker側で行う
例:
sudo kubeadm join 192.168.13.1:6443 --token yxxpjz.mxaw9w3q3st8vvpd --discovery-token-ca-cert-hash sha256:c217f2bed58632db7fc741af9aba7ba53326f692a8ac3705b08c6f61fe1bde
0 件のコメント:
コメントを投稿