K8s-helm2部署Dashboard
使用Helm部署 dashboard
dashboard.yaml:
#为了方便测试,先将已经有的dashboard镜像上传到我个人的镜像仓库,以下模板就可以基于我的仓库进行下载即可
image:
repository: chenxiyanglinux/dashboard
tag: v1.10.1
ingress:
enabled: true
hosts:
- dashboard.cmft.com
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
tls:
- secretName: frognew-com-tls-secret
hosts:
- dashboard.cmft.com
rbac:
clusterAdminRole: true
#以下是基于网络模式部署,可将stable/kubernetes-dashboard 改为.即可本地部署
$ helm install . --generate-name \
-n kubernetes-dashboard \
--namespace kube-system \
-f dashboard.yaml
$ kubectl -n kube-system get secret | grep kubernetes-dashboard-token
kubernetes.io/service-account-token 3 3m7s
$ kubectl describe -n kube-system secret/kubernetes-dashboard-token-pkm2s
$ kubectl edit svc kubernetes-dashboard -n kube-system
# 修改 ClusterIP 为 NodePort,可供外部访问