kubernetes kubectl执行错误拨号后端:x509:证书由未知授权机构签名

pes8fvy9  于 2023-01-16  发布在  Kubernetes
关注(0)|答案(1)|浏览(345)

经过长时间的努力,我刚刚创建了我的集群,部署了一个示例容器busybox现在我试图运行命令exec,我得到以下错误:

拨号后端错误:x509:证书由未知授权机构签名

我怎么解决这个问题:下面是v=9日志级别的命令输出。kubectl exec -v=9 -ti busybox -- nslookup kubernetes我还注意到,在日志中,这个失败的curl命令实际上是第一个GET命令传递的第二个命令,它返回的结果没有任何问题。(GET https://myloadbalancer.local:6443/api/v1/namespaces/default/pods/busybox 200 OK

curl -k -v -XPOST  -H "X-Stream-Protocol-Version: v4.channel.k8s.io" -H "X-Stream-Protocol-Version: v3.channel.k8s.io" -H "X-Stream-Protocol-Version: v2.channel.k8s.io" -H "X-Stream-Protocol-Version: channel.k8s.io" -H "User-Agent: kubectl/v1.19.0 (linux/amd64) kubernetes/e199641" 'https://myloadbalancer.local:6443/api/v1/namespaces/default/pods/busybox/exec?command=nslookup&command=kubernetes&container=busybox&stdin=true&stdout=true&tty=true'
I1018 02:19:40.776134  129813 round_trippers.go:443] POST https://myloadbalancer.local:6443/api/v1/namespaces/default/pods/busybox/exec?command=nslookup&command=kubernetes&container=busybox&stdin=true&stdout=true&tty=true 500 Internal Server Error in 43 milliseconds
I1018 02:19:40.776189  129813 round_trippers.go:449] Response Headers:
I1018 02:19:40.776206  129813 round_trippers.go:452]     Content-Type: application/json
I1018 02:19:40.776234  129813 round_trippers.go:452]     Date: Sun, 18 Oct 2020 02:19:40 GMT
I1018 02:19:40.776264  129813 round_trippers.go:452]     Content-Length: 161
I1018 02:19:40.776277  129813 round_trippers.go:452]     Cache-Control: no-cache, private
I1018 02:19:40.777904  129813 helpers.go:216] server response object: [{
  "metadata": {},
  "status": "Failure",
  "message": "error dialing backend: x509: certificate signed by unknown authority",
  "code": 500
}]
F1018 02:19:40.778081  129813 helpers.go:115] Error from server: error dialing backend: x509: certificate signed by unknown authority
goroutine 1 [running]:

添加更多信息:这是在UBUNTU 20.04上。作为一个初学者,我一步一步地手动创建了我的集群,我需要这种经验,而不是使用kubeadm或minikube之类的工具

xxxx@master01:~$ kubectl exec -ti busybox -- nslookup kubernetes
Error from server: error dialing backend: x509: certificate signed by unknown authority
xxxx@master01:~$ kubectl get pods --all-namespaces
NAMESPACE              NAME                                         READY   STATUS    RESTARTS   AGE
default                busybox                                      1/1     Running   52         2d5h
kube-system            coredns-78cb77577b-lbp87                     1/1     Running   0          2d5h
kube-system            coredns-78cb77577b-n7rvg                     1/1     Running   0          2d5h
kube-system            weave-net-d9jb6                              2/2     Running   7          2d5h
kube-system            weave-net-nsqss                              2/2     Running   0          2d14h
kube-system            weave-net-wnbq7                              2/2     Running   7          2d5h
kube-system            weave-net-zfsmn                              2/2     Running   0          2d14h
kubernetes-dashboard   dashboard-metrics-scraper-7b59f7d4df-dhcpn   1/1     Running   0          2d3h
kubernetes-dashboard   kubernetes-dashboard-665f4c5ff-6qnzp         1/1     Running   7          2d3h
tinashe@master01:~$ kubectl logs busybox
Error from server: Get "https://worker01:10250/containerLogs/default/busybox/busybox": x509: certificate signed by unknown authority
xxxx@master01:~$

xxxx@master01:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3", GitCommit:"1e11e4a2108024935ecfcb2912226cedeafd99df", GitTreeState:"clean", BuildDate:"2020-10-14T12:50:19Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3", GitCommit:"1e11e4a2108024935ecfcb2912226cedeafd99df", GitTreeState:"clean", BuildDate:"2020-10-14T12:41:49Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
bmp9r5qi

bmp9r5qi1#

**为简明起见编辑如下:

我的群集操作员kube-apiserver降级,导致证书失败。解决降级是解决导致x509错误的首要问题所必需的。请验证所有主服务器是否处于就绪状态,apiserver项目中的pod是否也已计划并就绪。有关详细信息,请参阅下面的KCS:
https://access.redhat.com/solutions/4849711

**删除了以下有关本地证书提取/导出的过时/不正确信息。

相关问题