mirror of
https://github.com/yeasy/docker_practice.git
synced 2024-11-28 09:18:54 +00:00
[Kubernetes] Add dashboard
Signed-off-by: Kang HuaiShuai <khs1994@khs1994.com>
This commit is contained in:
parent
386b1e4cf6
commit
e77c9ecbab
@ -112,6 +112,7 @@ module.exports = {
|
|||||||
"setup/kubeadm",
|
"setup/kubeadm",
|
||||||
"setup/docker-desktop",
|
"setup/docker-desktop",
|
||||||
"setup/systemd",
|
"setup/systemd",
|
||||||
|
"setup/dashboard",
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -124,6 +124,7 @@
|
|||||||
* [使用 kubeadm 部署 kubernetes](kubernetes/setup/kubeadm.md)
|
* [使用 kubeadm 部署 kubernetes](kubernetes/setup/kubeadm.md)
|
||||||
* [在 Docker Desktop 使用](kubernetes/setup/docker-desktop.md)
|
* [在 Docker Desktop 使用](kubernetes/setup/docker-desktop.md)
|
||||||
* [一步步部署 kubernetes 集群](kubernetes/setup/systemd.md)
|
* [一步步部署 kubernetes 集群](kubernetes/setup/systemd.md)
|
||||||
|
* [部署 Dashboard](kubernetes/setup/dashboard.md)
|
||||||
* [Kubernetes 命令行 kubectl](kubernetes/kubectl/README.md)
|
* [Kubernetes 命令行 kubectl](kubernetes/kubectl/README.md)
|
||||||
* [容器与云计算](cloud/README.md)
|
* [容器与云计算](cloud/README.md)
|
||||||
* [简介](cloud/intro.md)
|
* [简介](cloud/intro.md)
|
||||||
@ -160,8 +161,8 @@
|
|||||||
* [MongoDB](appendix/repo/mongodb.md)
|
* [MongoDB](appendix/repo/mongodb.md)
|
||||||
* [Redis](appendix/repo/redis.md)
|
* [Redis](appendix/repo/redis.md)
|
||||||
* [附录三:Docker 命令查询](appendix/command/README.md)
|
* [附录三:Docker 命令查询](appendix/command/README.md)
|
||||||
* [客户端命令 (docker)](appendix/command/docker.md)
|
* [客户端命令 -- docker](appendix/command/docker.md)
|
||||||
* [服务端命令 (dockerd)](appendix/command/dockerd.md)
|
* [服务端命令 -- dockerd](appendix/command/dockerd.md)
|
||||||
* [附录四:Dockerfile 最佳实践](appendix/best_practices.md)
|
* [附录四:Dockerfile 最佳实践](appendix/best_practices.md)
|
||||||
* [附录五:如何调试 Docker](appendix/debug.md)
|
* [附录五:如何调试 Docker](appendix/debug.md)
|
||||||
* [附录六:资源链接](appendix/resources.md)
|
* [附录六:资源链接](appendix/resources.md)
|
||||||
|
45
kubernetes/setup/dashboard.md
Normal file
45
kubernetes/setup/dashboard.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Kubernetes Dashboard
|
||||||
|
|
||||||
|
[Kubernetes Dashboard](https://github.com/kubernetes/dashboard) 是基于网页的 Kubernetes 用户界面。
|
||||||
|
|
||||||
|
![](https://d33wubrfki0l68.cloudfront.net/349824f68836152722dab89465835e604719caea/6e0b7/images/docs/ui-dashboard.png)
|
||||||
|
|
||||||
|
## 部署
|
||||||
|
|
||||||
|
执行以下命令即可部署 Dashboard:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
## 访问
|
||||||
|
|
||||||
|
通过命令行代理访问,执行以下命令:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ kubectl proxy
|
||||||
|
```
|
||||||
|
|
||||||
|
到 http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/ 即可访问。
|
||||||
|
|
||||||
|
## 登录
|
||||||
|
|
||||||
|
目前,Dashboard 仅支持使用 Bearer 令牌登录。下面教大家如何创建该令牌:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ kubectl create sa dashboard-admin -n kube-system
|
||||||
|
|
||||||
|
$ kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin
|
||||||
|
|
||||||
|
$ ADMIN_SECRET=$(kubectl get secrets -n kube-system | grep dashboard-admin | awk '{print $1}')
|
||||||
|
|
||||||
|
$ DASHBOARD_LOGIN_TOKEN=$(kubectl describe secret -n kube-system ${ADMIN_SECRET} | grep -E '^token' | awk '{print $2}')
|
||||||
|
|
||||||
|
echo ${DASHBOARD_LOGIN_TOKEN}
|
||||||
|
```
|
||||||
|
|
||||||
|
将结果粘贴到登录页面,即可登录。
|
||||||
|
|
||||||
|
## 参考文档
|
||||||
|
|
||||||
|
* [官方文档](https://kubernetes.io/zh/docs/tasks/access-application-cluster/web-ui-dashboard/)
|
@ -181,3 +181,7 @@ $ kubectl taint nodes --all node-role.kubernetes.io/master-
|
|||||||
# 恢复默认值
|
# 恢复默认值
|
||||||
# $ kubectl taint nodes NODE_NAME node-role.kubernetes.io/master=true:NoSchedule
|
# $ kubectl taint nodes NODE_NAME node-role.kubernetes.io/master=true:NoSchedule
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 参考文档
|
||||||
|
|
||||||
|
* [官方文档](https://kubernetes.io/zh/docs/setup/independent/create-cluster-kubeadm/)
|
||||||
|
Loading…
Reference in New Issue
Block a user