-
安装containerd
注意修改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
- 安装kubedm
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 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
|
- 部署网络插件(canal,或其他)
|--------------------------------------------------------------------------------------------------|
| 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-
|
- 检查节点状态
|--------------------|
| kubectl get node
|
- 测试pod:kubectl apply test.yaml
|-------------------------------------------------------------------------------------------------------------------------------|
| apiVersion: v1
kind: Pod
metadata:
``name: test-pod
spec:
``containers:
``- name: test-pod
``image: nginx
|