一、环境准备及测试
1、报错处理:
kube-system calico-node-5wvln 0/1 Init:0/3 0 16h kube-system calico-node-d7xfb 0/1 Init:0/3 0 16h kube-system calico-node-k84tc 0/1 Init:0/3 0 16h
执行以下命令:更新内核版本
yum list kernel
yum update kernel
reboot
如果是cni报错,需要上传下面两个文件,然后重启
一直不成功挂起状态
再/etc/cni/net.d/中上传文件
kube-system calico-node-5wvln 0/1 Init:0/3 0 16h kube-system calico-node-d7xfb 0/1 Init:0/3 0 16h kube-system calico-node-k84tc 1/1 Running 0 16h
[root@k8s-master ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master Ready control-plane 16h v1.28.2 k8s-node1 Ready <none> 16h v1.28.2 k8s-node2 Ready <none> 16h v1.28.2
现在就合适了
kubectl 无法补全报错ku-bash: _get_comp_words_by_ref: command not found
[root@k8s-master ~]# yum -y install bash-completion
[root@k8s-master ~]# bash /usr/share/bash-completion/bash_completion
[root@k8s-master ~]# bash
2、测试:
创建nginx镜像名称为nginx0
[root@k8s-master ~]# kubectl run nginx0 --image=nginx:latest
pod/nginx0 created
[root@k8s-master ~]# kubectl get po -Aowidedefault nginx0 0/1 ContainerCreating 0 29s <none> k8s-node2 <none> <none>
查看日志
[root@k8s-master ~]# kubectl logs nginx0
Error from server (BadRequest): container "nginx0" in pod "nginx0" is waiting to start: ContainerCre