安装dashboard

docker加载镜像

docker load -i dashboard.tar

在install-k8s文件夹下面创建dashboard文件夹

cd /usr/local/install-k8s/plugin
mkdir dashboard
cd dashboard

查看helm仓库

helm repo list

helm增加stable的镜像源

helm repo add stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

更新helm仓库

helm repo update

helm获取dashboard

helm fetch stable/kubernetes-dashboard

新建kubernetes-dashboard.yaml文件

image:
  repository: k8s.gcr.io/kubernetes-dashboard-amd64
  tag: v1.10.1
ingress:
enabled: true
hosts:
   - k8s.frognew.com
annotations:
  nginx.ingress.kubernetes.io/ssl-redirect: "true"
  nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
tls:
- secretName: frognew-com-tls-secret
   hosts:
   - k8s.frognew.com
rbac:
clusterAdminRole: true

通过helm安装dashboard

helm install . -n kubernetes-dashboard --namespace kube-system -f kubernetes-dashboard.yaml

删除名称空间为kube-system下的pod

kubectl delete pod kubernetes-dashboard-79599d7b8d-bnpp2 -n kube-system

编辑dashboard服务,type改为NodePort

kubectl edit svc kubernetes-dashboard -n kube-system

查看pod情况(安装过程中可不执行)

kubectl get pod -n kube-system -o wide

获取名称空间在kube-system下面的服务,查看服务情况

kubectl get svc -n kube-system

获取登录token,其中高亮部分需要替换以下第一条语句执行的token名称

kubectl -n kube-system get secret |grep kubernetes-dashboard-token
kubectl describe secret kubernetes-dashboard-token-llqjx -n kube-system
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐