注意修改containerd配置中镜像相关的配置:/etc/containerd/config.toml
-
修改kubeadm配置
yum install -y kubeadm- 1.25 . 2 kubectl- 1.25 . 2 kubelet- 1.25 . 2 kubeadm config print init-defaults > kubeadm.yaml |
修改podSubnet和serviceSubnet
kubeadm init --config kubeadm.yaml mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config export KUBECONFIG=/etc/kubernetes/admin.conf |
wget https: //docs.projectcalico.org/v3.23/manifests/canal.yaml kubectl apply -f canal.yaml |
kubectl taint node k8s004 node-role.kubernetes.io/control-plane- kubectl taint node k8s004 node-role.kubernetes.io/master- |
- 测试pod:kubectl apply test.yaml
apiVersion: v1 kind: Pod metadata: name: test-pod spec: containers: - name: test-pod image: nginx |