Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

Code Block
languagebash
themeDJango
linenumberstrue
yum -y install docker-ce

Execute screenshot

img13pngImage RemovedImage Added

2.3 Set docker to boot and confirm docker status

...

Code Block
languagebash
themeDJango
linenumberstrue
systemctl enable docker
systemctl start docker
systemctl status docker

Execute screenshot

img12pngImage RemovedImage Added

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

img27pngImage RemovedImage Added

If it is cgroupfs, add the following statement

...

Code Block
languagebash
themeDJango
linenumberstrue
systemctl daemon-reload && systemctl restart docker
docker info | grep -i cgroup

Image Added

3 Install k8s basic components

...

Code Block
languagebash
themeDJango
linenumberstrue
yum list installed | grep kube

Execute screenshot

img28pngImage RemovedImage Added

3.2 Install kubelet kubeadm kubectl version 1.23.7

...

Code Block
languagebash
themeDJango
linenumberstrue
yum -y install kubelet-1.23.7 kubeadm-1.23.7 kubectl-1.23.7

Execute screenshot

Image Added

img14pngImage RemovedImage Added

3.3 Verify installation

...

Code Block
languagebash
themeDJango
linenumberstrue
kubelet --version
kubeadm version
kubectl version

Execute screenshot

img31pngImage RemovedImage Added

4 Initialize the master

...

Code Block
languagebash
themeDJango
linenumberstrue
# 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

img32pngImage RemovedImage Added

img33pngImage RemovedImage Added

Please make sure that the above 7 images have been pulled down

...

Code Block
languagebash
themeDJango
linenumberstrue
# master
kubeadm init --image-repository registry.aliyuncs.com/google_containers --kubernetes-version=v1.23.7 --pod-network-cidr=10.10.0.0/16

Execute screenshot



img35png

Let kubectl take effect

Execute command

Code Block
languagebash
themeDJango
linenumberstrue
# 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

img36pngImage RemovedImage Added


We can see that the coredns is not ready, so we need configure the network plugin

...

Here select cilium as the network plugin

Confirm that your current default version of the kernel is above 4.9

Check the current kernel version

Execute command

Code Block
languagebash
themeDJango
linenumberstrue
# master  
uname -sr

...

Code Block
languagebash
themeDJango
linenumberstrue
# master
kubeadm token create --print-join-command

Execute screenshot

img20pngImage RemovedImage Added

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

img19pngImage Removed


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
languagebash
themeDJango
linenumberstrue
# master
kubectl get nodes

Execute screenshot

img18pngImage RemovedImage Added

6 Install karmada

...

7 Propagate a deployment by Karmada


Before propagating a deployment, make sure the worker cluster is already working properly

In the following steps, we are going to propagate a deployment by Karmada. We use the installation of nginx as an example


7.1 Join a worker/member cluster to karmada control plane

Here we add the working node cluster through push mode


Execute command


Code Block
languagebash
themeDJango
linenumberstrue
kubectl karmada join worker-cluster --cluster-kubeconfig=prod --cluster-context=prod

...