【问题标题】:Kubernetes-dashboard pod is crashing again and againKubernetes-dashboard pod 一次又一次地崩溃
【发布时间】:2019-02-15 18:54:16
【问题描述】:

我已经在我的 ubuntu 机器上安装并配置了 Kubernetes,按照这个Document

部署 Kubernetes-dashboard 后,容器不断崩溃

kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

使用以下方式启动代理:

kubectl proxy --address='0.0.0.0' --accept-hosts='.*' --port=8001

Pod 状态:

kubectl get pods -o wide --all-namespaces
....
....
kube-system   kubernetes-dashboard-64576d84bd-z6pff     0/1       CrashLoopBackOff   26         2h        192.168.162.87   kb-node     <none>

Kubernetes 系统日志:

root@KB-master:~# kubectl -n kube-system logs kubernetes-dashboard-64576d84bd-z6pff --follow
2018/09/11 09:27:03 Starting overwatch
2018/09/11 09:27:03 Using apiserver-host location: http://192.168.33.30:8001
2018/09/11 09:27:03 Skipping in-cluster config
2018/09/11 09:27:03 Using random key for csrf signing
2018/09/11 09:27:03 No request provided. Skipping authorization
2018/09/11 09:27:33 Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service account's configuration) or the --apiserver-host param points to a server that does not exist. Reason: Get http://192.168.33.30:8001/version: dial tcp 192.168.33.30:8001: i/o timeout
Refer to our FAQ and wiki pages for more information: https://github.com/kubernetes/dashboard/wiki/FAQ

当我尝试在浏览器上点击以下链接时获取消息

URL:http://192.168.33.30:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login

Error: 'dial tcp 192.168.162.87:8443: connect: connection refused'
Trying to reach: 'https://192.168.162.87:8443/'

任何人都可以帮助我。

【问题讨论】:

  • kubectl logs k8s-be-30691--648714b534f3a09b/kubectl logs -p k8s-be-30691--648714b534f3a09b 会很方便,kubectl describe pod k8s-be-30691--648714b534f3a09b 也会很方便
  • 看起来是这个原因:http://192.168.33.30:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard: /proxy/#!/login 你的 API 服务器的端点是什么?
  • 你们能描述更多吗?

标签: kubernetes kubernetes-dashboard


【解决方案1】:

http://192.168.33.30:8001 不是合法的 API 服务器 URL。与 API 服务器的所有通信都在内部使用 TLS(https:// URL 方案)。这些通信使用 API 服务器 CA 证书进行验证,并通过同一 CA 签名的令牌进行身份验证。

您看到的是配置错误的结果。乍一看,您似乎混合了 pod、服务和主机网络。

确保您了解 Host 网络、Pod 网络和 Service 网络之间的区别。这三个网络不能重叠。例如,--pod-network-cidr=192.168.0.0/16 必须不包含您主机的 IP 地址,如有必要,请将其更改为 10.0.0.0/16 或更小的值。

清楚了解网络拓扑后,再次运行设置,一切都会正确配置,包括 Kubernetes CA。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-16
    • 1970-01-01
    • 1970-01-01
    • 2021-11-14
    • 2018-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多