我在本地K8上吊舱时遇到了麻烦。它安装在Ubuntu 18.04(1个主VM,1个节点VM)上。
Kubernetes-Master:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:09:08Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Kubernetes-Slave:/var/lib/kubelet/pki$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
我注意到以下情况(从站=工作节点):
Kubernetes-Master:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
kubernetes-master NotReady master 62d v1.17.0
kubernetes-slave NotReady <none> 62d v1.17.0
通过检查节点:
Kubernetes-Master:~$ kubelet
F1223 10:25:38.045551 20431 server.go:253] error reading /var/lib/kubelet/pki/kubelet.key, certificate and key must be supplied as a pair
Kubernetes-Slave:/var/lib/kubelet/pki$ kubelet
F1223 10:20:14.651684 3558 server.go:253] error reading /var/lib/kubelet/pki/kubelet.key, certificate and key must be supplied as a pair
两个VM都关闭了几天。引导后,一个Pod无法启动。重启一遍,所有豆荚都停下来了:
Kubernetes-Master:~$ kubectl get all -o wide -n gitbucket
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/gitbucket-svc ClusterIP 10.97.69.199 <none> 8080/TCP 67m app=gitbucket
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
deployment.apps/gitbucket 0/1 0 0 67m gitbucket gitbucket/gitbucket:latest app=gitbucket
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
replicaset.apps/gitbucket-67cc5686df 1 0 0 67m gitbucket gitbucket/gitbucket:latest app=gitbucket,pod-template-hash=67cc5686df
知道发生了什么吗?
答案 0 :(得分:0)
您可能对node-authorization有疑问。多亏了节点授权者,kubelet才能执行API操作。
然后,将对任何成功通过身份验证的请求(包括匿名请求)进行授权。默认授权模式为AlwaysAllow,它允许所有请求-kubelet authorization。
细分访问kubelet API的原因有很多:
要细分对kubelet API的访问权限,请将授权委派给API服务器:
--authorization-mode=Webhook
和
--kubeconfig
标记kubelet调用已配置的API服务器上的SubjectAccessReview API,以确定每个请求是否
授权您可以在这里找到更多信息:pki-kubernetes。
Kubernetes中的身份验证:auth-kubernetes。
答案 1 :(得分:0)
我想我找到了问题。从Kubernetes 1.16切换到1.17时,这与CSInode上的更改有关。升级内存后,我运行了计划的补丁程序(Ubuntu Landscape),该补丁程序从1.16迁移到1.17。详细信息可以在这里找到:Worker start to fail CSINodeIfo: error updating CSINode annotation
此处记录了升级的详细信息(有效):https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
如果您使用ISTIO:
Istio(在我的情况下为1.3.3)将阻止升级。如果要执行升级到Kubernetes 1.17的升级,最简单的方法是卸载istio,然后在更新完成后重新安装它。我在istio上找不到定义的迁移路径(只有错误或功能讨论)。请记住: