...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
yum -y install docker-ce |
Execute screenshot
2.3 Set docker to boot and confirm docker status
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
systemctl enable docker systemctl start docker systemctl status docker |
Execute screenshot
2.4 Configure the driver of docker's cgroup
...
Check the current configuration, if it is the system in the figure below, skip the follow-up and go directly to the third section
Execute screenshot
If it is cgroupfs, add the following statement
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
systemctl daemon-reload && systemctl restart docker docker info | grep -i cgroup |
3 Install k8s basic components
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
yum list installed | grep kube |
Execute screenshot
3.2 Install kubelet kubeadm kubectl version 1.23.7
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
yum -y install kubelet-1.23.7 kubeadm-1.23.7 kubectl-1.23.7 |
Execute screenshot
3.3 Verify installation
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
kubelet --version kubeadm version kubectl version |
Execute screenshot
4 Initialize the master
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# master kubeadm config images list --kubernetes-version=v1.23.7 |sed -e 's/^/docker pull /g' -e 's#k8s.gcr.io#registry.aliyuncs.com/google_containers#g' |sh -x docker pull registry.aliyuncs.com/google_containers/coredns:v1.8.6 docker images |
Execute screenshot
Please make sure that the above 7 images have been pulled down
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# master mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config kubectl get po -A |
Execute screenshot
We can see that the coredns is not ready, so we need configure the network plugin
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# master kubeadm token create --print-join-command |
Execute screenshot
5.2 Join the master node
...
When you have the join statement, copy it and execute it on the worker node, you can see
Execute screenshot
Note that if an error occurs and you need to re-init, you need to execute the following statement first to ensure that kubeadm is re-executed normally
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# master kubectl get nodes |
Execute screenshot
6 Install karmada
...