故障现象:升级完k8s后,部署pod时发现pod无法被调度到node节点,pod的状态一直是pending状态。
报错内容:User-scheduler pods fail with “no kind “KubeSchedulerConfiguration” is registered for version “kubescheduler.config.k8s.io/v1beta1” or with CSI failures when apiVersion is changed to v1beta3
排查思路:kube-schedule这个组件是负责pod的调度,一看kube-schedule状态是failed
root@k8s-master2:~# journalctl -xe|grep kube-schedule
故障原因:根据报错提示,应该是kube-schedule组件的api类型不匹配导致的
解决问题思路:修改kube-scheduler-config.yaml文件
root@k8s-master1:/app/yaml/dashboard# cat /etc/kubernetes/kube-scheduler-config.yaml
apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
clientConnection:kubeconfig: "/etc/kubernetes/kube-scheduler.kubeconfig"
leaderElection:leaderElect: trueroot@k8s-master1:/app/yaml/dashboard# systemctl restart kube-scheduler.service
这次故障的原因就是我把k8s的版本从1.22.3升级到1.23.9导致的,1.22版本的kube-schedule和1.23版本的kube-schedule api类型是不一样的