码迷,mamicode.com
首页 > Web开发 > 详细

Kubernetes dashboard安装

时间:2019-04-05 19:44:40      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:sse   Kubernete   note   serve   home   environ   doc   mic   error   

1. To download Dashboard plugin deployment YAML file from internet.

#cd /home

#mkdir k8s

#cd k8s

# wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

 ##官方链接https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/

 

2. To Create certificate for dashboard

 

# mkdir certs

# openssl req -nodes -newkey rsa:2048 -keyout certs/dashboard.key -out certs/dashboard.csr -subj "/C=/ST=/L=/O=/OU=/CN=kubernetes-dashboard"

# openssl x509 -req -sha256 -days 365 -in certs/dashboard.csr -signkey certs/dashboard.key -out certs/dashboard.crt

# kubectl create secret generic kubernetes-dashboard-certs --from-file=certs -n kube-system

 

 

3.To modify the default kubernetes-dashboard.yaml file, Modify the rbac parameter, and add type: NodePort to expose Dashboard service can be accessed by outside.

# vi kubernetes-dashboard.yaml

 技术图片

 

技术图片

                       

 

4.To create Dashboard

# kubectl create -f kubernetes-dashboard.yaml

 技术图片

 

5.To get NodePort and access token.

 

# kubectl -n kube-system get secret | grep kubernetes-dashboard

 技术图片

# kubectl describe -n kube-system secret/kubernetes-dashboard-token-xxxxx

 技术图片

 

  # kubectl get svc -n kube-system  (Dashboard runs on port 32580)

 技术图片

 

 6. To access the Dashboard (https://192.168.4.200:32580)

 技术图片

 

 

 技术图片

 技术图片

 

  

Note:

1)    If you login the dashboard , you find the dashboard show error like “User "system:anonymous" cannot get at the cluster scope.”,  
 
 技术图片

 

 

# vi /etc/kubernetes/manifests/kube-apiserver.yaml

 

添加如下参数:

--anonymous-auth=false

 技术图片

 

 

2)    Kube-apiserver down after installing the kubernetes dashboard?

 

Change or add bellow parameters.(bellow is for only one master lab environment)

  

    - --insecure-bind-address=127.0.0.1

    - --insecure-port=8080

 

    livenessProbe:

      failureThreshold: 8

      httpGet:

        host: 127.0.0.1

        path: /healthz

        port: 8080

        scheme: HTTP

      initialDelaySeconds: 15

      timeoutSeconds: 15

Kubernetes dashboard安装

标签:sse   Kubernete   note   serve   home   environ   doc   mic   error   

原文地址:https://www.cnblogs.com/cnmumian/p/10659531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!