接上篇,kubernetes-dashboard安装完访问出现各种问题,但又不想来回重新装,所以跟遇到的问题来回折腾。

采坑第一:master和node上都要安装好docker,因为安装k8s的时候会安装自带的docker,在

yum install docker-engine

提示报错:docker-engine conflicts with 2:docker-1.12.6-68.gitec8512b.el7.centos.x86_64

解决方法:yum install docker-engine  --skip-broken


采坑第二:在master上运行docker ps 发现报错,以前一直以为装完没问题。

提示报错:

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

解决方法:可能是跟操作系统有关系不支持selinux(centos7)

vi  /etc/sysconfig/docker

OPTIONS=‘--selinux-enabled=false --log-driver=journald --signature-verification=false‘

if [ -z "${DOCKER_CERT_PATH}" ]; then

DOCKER_CERT_PATH=/etc/docker

fi

重启docker    systemctl  restart docker 

采坑第三:在访问http://ip:8080/ui提示

Error: 'dial tcp 10.0.66.2:9090: getsockopt: connection timed out'

Trying to reach: 'http://10.0.66.2:9090/'

解决方法:vi /usr/lib/systemd/system/docker.service

 [Service] 下添加

ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT

采坑第四:访问http://121.201.29.62:8080/ui时报错:

{

  "kind": "Status",

  "apiVersion": "v1",

  "metadata": {},

  "status": "Failure",

  "message": "no endpoints available for service \"kubernetes-dashboard\"",

  "reason": "ServiceUnavailable",

  "code": 503

}

执行kubectl get pods --namespace kube-system查看状态是不是running,如果不是查看node的镜像是否启动。因为我的dashboard是装在master上,然后k8s服务image是在node上,在master上操作没关注node上image是否在启动,最后node的镜像启动了,访问就没问题了。

最后是久违了的dashboard

 


GitHub 加速计划 / da / dashboard
8
2
下载
General-purpose web UI for Kubernetes clusters
最近提交(Master分支:16 天前 )
2f3f7b01 * feat(pod): add GPU resource allocation support and refactor request/limit functions * test(pod): add GPU allocation resource validation in unit tests 14 小时前
1d1d9f43 * Add argument to Dashboard API to allow for a custom CA bundle * add tls bundle to auth * fix CA file usage with custom bundle path * override client config to after config exiss * fix whitespace * Review arguments documentation 6 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐