示例:
[root@server1 ~]# mkdir dashboard
[root@server1 ~]# cd dashboard/
[root@server1 dashboard]# wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.0/aio/deploy/recommended.yaml
[root@server1 dashboard]# vim recommended.yaml
[root@server1 dashboard]# kubectl apply -f recommended.yaml
[root@server1 dashboard]# kubectl -n kubernetes-dashboard edit svc
service/dashboard-metrics-scraper skipped
service/kubernetes-dashboard edited
修改:
https://192.168.76.60:30107
1.23.10 ----> 1.24.4
由于1.24版本不能直接兼容docker引擎,
Docker Engine 没有实现CRI,这是容器运行时在kubernetes中工作所在需要的。
为此,必须安装一个额外的服务cri-dockerd。cri-dockerd是一个基于传统的内置Docker引擎2支持的项目。
它在1.24版本从kubelet中移除。
yum install cri-dockerd-0.2.5-3.el7.x86_64.rpm
vim /usr/lib/systemd/system/cri-docker.service
编辑:
Type=notify
ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plugin=cni --pod-infra-container-image=reg.westos.org/k8s/pause:3.7
systemctl daemon-reload
systemctl enable --now cri-docker
yum install -y kubeadm-1.24.4-0 kubectl-1.24.4-0 kubelet-1.24.4-0
systemctl enable --now kubelet
kubeadm init --pod-network-cidr=10.244.0.0/16 --image-repository=reg.westos.org/k8s --cri-socket=unix:///var/run/cri-dockerd.sock
yum install -y kubeadm-1.24.4-0
kubeadm upgrade plan
kubeadm upgrade apply v1.24.4
kubectl drain server1 --ignore-daemonsets
yum install -y kubelet-1.24.4-0 kubectl-1.24.4-0
vim /var/lib/kubelet/kubeadm-flags.env
编辑:
KUBELET_KUBEADM_ARGS="--pod-infra-container-image=reg.westos.org/k8s/pause:3.7 --container-runtime=remote --container-runtime-endpoint=unix:///var/run/cri-dockerd.sock"
kubectl edit nodes server1
...
kubeadm.alpha.kubernetes.io/cri-socket: unix:///var/run/cri-dockerd.sock
systemctl daemon-reload
systemctl restart kubelet
kubectl uncordon server1