首先把addon的代码下载下来

git clone https://github.com/minishift/minishift-addons

然后进入相应的目录,运行

ericdeMacBook-Pro:add-ons ericnie$ minishift addon apply kube-dashboard
-- Applying addon 'kube-dashboard':........Command "deploy" is deprecated, Use the `rollout latest` and `rollout cancel` commands instead.

注意kube-dashboard这个是目录啊。看到这个命令在里面停了半天,然后退出,查看addon文件

不难发现镜像指到墙外去了....

oc create deploymentconfig dashboard --image=gcr.io/google_containers/kubernetes-dashboard-amd64:v1.8.3 -n kube-dashboard

果断同步到自己的repository.然后修改完如下,注意标黑体的地方

ericdeMacBook-Pro:kube-dashboard ericnie$ cat kube-dashboard.addon
# Name: kube-dashboard
# Description: Deploys the kubernetes dashboard
# Url: https://github.com/kubernetes/dashboard # oc adm policy add-scc-to-user anyuid system:serviceaccount:kube-dashboard:default
oc adm new-project kube-dashboard
oc create deploymentconfig dashboard --image=ericnie2017/kubernetes-dashboard-amd64:latest -n kube-dashboard
oc label dc/dashboard app=kube-dashboard -n kube-dashboard
oc set probe dc/dashboard --readiness --liveness --open-tcp= --initial-delay-seconds= --timeout-seconds= -n kube-dashboard
oc expose dc/dashboard --port= -l app=kube-dashboard -n kube-dashboard
oc expose svc/dashboard --hostname=dashboard.192.168.99.100.nip.io -l app=kube-dashboard -n kube-dashboard
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:kube-dashboard:default
oc deploy dashboard -n kube-dashboard
oc rollout status dc/dashboard -n kube-dashboard echo You have installed #{addon-name}
echo To access the #{addon-name} go to http://dashboard.#{routing-suffix}
echo or
echo Use minishift:
echo minishift openshift service dashboard -n kube-dashboard
echo
echo To delete:
echo oc delete project/kube-dashboard --as=system:admin

如果运行还不出来,可以通过

oc delete project/kube-dashboard

删除命名空间,然后再一条条语句执行,最后访问

CDK上安装kube-dashboard-LMLPHP

05-26 14:46