首页
随机
最近更改
特殊页面
社群首页
参数设置
关于WHY42
免责声明
WHY42
搜索
用户菜单
登录
欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。
查看“︁K8s:部署dashboard”︁的源代码
←
K8s:部署dashboard
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 部署 == <syntaxhighlight lang="bash"> # 部署 Kubernetes 仪表盘 GITHUB_URL=https://github.com/kubernetes/dashboard/releases VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||') sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml </syntaxhighlight> dashboard.admin-user.yml: <syntaxhighlight lang="yaml"> apiVersion: v1 kind: ServiceAccount metadata: name: admin-user namespace: kubernetes-dashboard </syntaxhighlight> dashboard.admin-user-role.yml: <syntaxhighlight lang="bash"> apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: admin-user roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: admin-user namespace: kubernetes-dashboard </syntaxhighlight> <syntaxhighlight lang="bash"> sudo k3s kubectl create -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml </syntaxhighlight> == 登录 == 在host使用kubectl <syntaxhighlight lang="bash"> kubectl -n kubernetes-dashboard describe secret admin-user-token | grep '^token' kubectl proxy </syntaxhighlight> 登录地址: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/ another way: <syntaxhighlight lang="bash"> sudo kubectl port-forward -n kubernetes-dashboard --address 0.0.0.0 service/kubernetes-dashboard 8080:443 </syntaxhighlight> https://<host ip>:8080 [[Category:Linux/Unix]]
返回
K8s:部署dashboard
。