dashboard
可以从微软中国提供的 gcr.io :http://mirror.azure.cn/help/gcr-proxy-cache.html免费代理下载被墙的镜像
docker pull gcr.azk8s.cn/google_containers/<imagename>:<version>
1. 下载文件
下载三个文件:https://github.com/gjmzj/kubeasz/tree/master/manifests/dashboard
[root@hs-k8s-master01 dashboard]# pwd
/data/k8s/dashboard
[root@hs-k8s-master01 dashboard]# ll
总用量 32
-rw-r--r-- 1 root root 843 2月 5 15:31 admin-user-sa-rbac.yaml
-rw-r--r-- 1 root root 8026 2月 5 15:38 kubernetes-dashboard.yaml
-rw-r--r-- 1 root root 3084 2月 5 15:33 read-user-sa-rbac.yaml 2. 部署dashboard主yaml配置文件
#修改镜像下载地址
[root@hs-k8s-master01 dashboard]# cat kubernetes-dashboard.yaml |grep image
image: registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard:v2.0.0-rc3
image: registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper:v1.0.3 [root@hs-k8s-master01 dashboard]# kubectl apply -f kubernetes-dashboard.yaml
secret/kubernetes-dashboard-certs created
serviceaccount/kubernetes-dashboard created
role.rbac.authorization.k8s.io/kubernetes-dashboard-minimal created
rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard-minimal created
deployment.apps/kubernetes-dashboard created
service/kubernetes-dashboard created 3. 创建可读可写admin Service Account
[root@hs-k8s-master01 dashboard]# kubectl apply -f admin-user-sa-rbac.yaml
serviceaccount/admin-user created
clusterrolebinding.rbac.authorization.k8s.io/admin-user created 4. 创建只读 read Service Account
[root@hs-k8s-master01 dashboard]# kubectl apply -f read-user-sa-rbac.yaml
serviceaccount/dashboard-read-user created
clusterrolebinding.rbac.authorization.k8s.io/dashboard-read-binding created
clusterrole.rbac.authorization.k8s.io/dashboard-read-clusterrole created 5. 查看
#查看pod运行状态
[root@hs-k8s-master01 dashboard]# kubectl get pod -n kube-system | grep dashboard
dashboard-metrics-scraper-6b66849c9-8lvqd 1/1 Running 0 23m
kubernetes-dashboard-6dc6c4f59-84526 1/1 Running 0 23m #查看dashboard service
[root@hs-k8s-master01 dashboard]# kubectl get svc -n kube-system|grep dashboard
dashboard-metrics-scraper ClusterIP 10.107.131.160 <none> 8000/TCP 23m
kubernetes-dashboard NodePort 10.99.144.160 <none> 443:31110/TCP 23m #查看集群服务
[root@hs-k8s-master01 dashboard]# kubectl cluster-info
Kubernetes master is running at https://20.0.0.250:8443
KubeDNS is running at https://20.0.0.250:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
kubernetes-dashboard is running at https://20.0.0.250:8443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. #查看pod运行日志
[root@hs-k8s-master01 dashboard]# kubectl logs kubernetes-dashboard-6dc6c4f59-84526 -n kube-system 6. 生成证书
供本地google浏览器使用
#生成client-certificate-data
[root@k8s-master01 dashboard]# grep 'client-certificate-data' ~/.kube/config | head -n 1 | awk '{print $2}' | base64 -d >> kubecfg.crt #生成client-key-data
[root@k8s-master01 dashboard]# grep 'client-key-data' ~/.kube/config | head -n 1 | awk '{print $2}' | base64 -d >> kubecfg.key #生成p12
[root@k8s-master01 dashboard]# openssl pkcs12 -export -clcerts -inkey kubecfg.key -in kubecfg.crt -out kubecfg.p12 -name "kubernetes-client"
Enter Export Password: 1
Verifying - Enter Export Password: 1
[root@hs-k8s-master01 dashboard]# ll
总用量 28
-rw-r--r-- 1 root root 843 2月 5 15:31 admin-user-sa-rbac.yaml
-rw-r--r-- 1 root root 1082 2月 5 15:41 kubecfg.crt
-rw-r--r-- 1 root root 1679 2月 5 15:41 kubecfg.key
-rw-r--r-- 1 root root 2464 2月 5 15:43 kubecfg.p12
-rw-r--r-- 1 root root 8026 2月 5 15:38 kubernetes-dashboard.yaml
-rw-r--r-- 1 root root 3084 2月 5 15:33 read-user-sa-rbac.yaml
[root@k8s-master01 dashboard]# sz kubecfg.p12
谷歌浏览器导入证书:
备注把上一步骤的kubecfg.p12 文件导入证书后需要重启浏览器: 7. 导出令牌
[root@hs-k8s-master01 dashboard]# kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
Name: admin-user-token-4d2r4
Namespace: kube-system
Labels: <none>
Annotations: kubernetes.io/service-account.name: admin-user
kubernetes.io/service-account.uid: cf8638e0-1434-4f61-aded-262f213dd803 Type: kubernetes.io/service-account-token Data
====
ca.crt: 1025 bytes
namespace: 11 bytes
token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjZaOTZ5MmR5MEs3eUVnclJ4R0MtOTNmVDlTTGlteGdzQ1RJc1ZZT2xvT00ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLTRkMnI0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJjZjg2MzhlMC0xNDM0LTRmNjEtYWRlZC0yNjJmMjEzZGQ4MDMiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06YWRtaW4tdXNlciJ9.HXlI_vXP4b9VVP6_jptMFjp99u1NLlmgC26ITfA7cHRPIyjxW6vKv97GjAOxF3Ne691cTZLcOAh_b1dNXExLkmUqKoWY8Cg_ys5hvQ2rcC_CEpS7S4shKWEb_DeLUUgr4UjjIDQKCH_tczX3nNpfsqiooMsMYkac-MlwgCHVvxgkqKmfrkub6ifP02yuaWBLhvuYvJc6DX_NvHQzy9w8FFbB2d4gpthzt_sinSR4x84MzgKHdOsj9CHXqwH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ard]# cp /root/.kube/config /data/k8s/tmp/k8s-dashboard.kubeconfig
[root@k8s-master01 dashboard]# sz /data/k8s/tmp/k8s-dashboard.kubeconfig

kubernetes dashboard 2.0 部署的更多相关文章

  1. Kubernetes V1.16.2部署Dashboard V2.0(beta5)

    Kubernetes V1.16.2部署Dashboard V2.0(beta5) 在Master上部署Dashboard 集群安装部署请看安装Kubernetes V1.16.2 kubectl g ...

  2. kubernetes学习之二进制部署1.16

    服务器规划和系统初始化 一.服务器规划 10.255.20.205 Master01 kube-apiserver.kube-controller-manager.kube-scheduler.ETC ...

  3. centos7下kubernetes(5。部署kubernetes dashboard)

    基于WEB的dashboard,用户可以用kubernetes dashboard部署容器话的应用,监控应用的状态,执行故障排查任务以及管理kubernetes各种资源. 在kubernetes da ...

  4. [原]部署kubernetes dashboard(二)

    #######################    以下为声明  ##################### 此文档是之前做笔记在两台机上进行的实践,kubernetes处于不断开发阶段 不能保证每 ...

  5. 微服务探索之路02篇liunx ubuntu服务器部署k8s(kubernetes)-kubernetes/dashboard

    本章介绍所需环境:ubuntu18.04,建立在上一篇微服务探索之路01篇已经安装了docker的基础上. 1 替换k8s镜像源为国内镜像 进入目录 cd /etc/apt/sources.list. ...

  6. kubernetes 1.14安装部署dashboard

    简单介绍: Dashboard是一个基于web的Kubernetes用户界面.您可以使用Dashboard将容器化应用程序部署到Kubernetes集群,对容器化应用程序进行故障诊断,并管理集群资源. ...

  7. 二进制方式部署Kubernetes 1.6.0集群(开启TLS)

    本节内容: Kubernetes简介 环境信息 创建TLS加密通信的证书和密钥 下载和配置 kubectl(kubecontrol) 命令行工具 创建 kubeconfig 文件 创建高可用 etcd ...

  8. Ubuntu下搭建Kubernetes集群(4)--部署K8S Dashboard

    K8S Dashboard是官方的一个基于WEB的用户界面,专门用来管理K8S集群,并可展示集群的状态.K8S集群安装好后默认没有包含Dashboard,我们需要额外创建它. 首先我们执行命令: wg ...

  9. Kubernetes 1.5.1 部署

    > kubernetes 1.5.0 , 配置文档 # 1 初始化环境 ## 1.1 环境: | 节 点  |      I P      ||--------|-------------||n ...

随机推荐

  1. Typescript & React & optional parameters & default parameters

    Typescript & React & optional parameters & default parameters Typescript & optional ...

  2. Flutter: 下拉刷新,上拉加载更多

    import 'package:flutter/material.dart'; import 'package:english_words/english_words.dart'; void main ...

  3. Baccarat项目专用代币BGV的价值如何?

    NGK投资者对于NGK平台自身的DeFi项目呼声越来越高,经过数月的紧张研发,检验和内测工作,NGK官方将于近日推出其去中心化金融项目--Baccarat,此项目为避免以太坊易被攻击,网络拥堵出块慢以 ...

  4. python 相对路径和绝对路径的区别

    一,Python中获得当前目录和上级目录 获取当前文件的路径: from os import path d = path.dirname(__file__) #返回当前文件所在的目录 # __file ...

  5. VMware安装centos.6.8无法访问主机的问题

    安装步骤 点击下一步,如下图: 接上图: 接上图: 接上图 接上图: 接上图: 接上图: 接上图 接上图: 接上图: 接上图: 接上图: 接上图: 接上图: 点击 完成: 启动虚拟机进行安装: 发现报 ...

  6. 【Notes_3】现代图形学入门——基础变换、MVP变换模型

    基础变换(二维) 三维变化与二维变换矩阵类似 齐次坐标下的基础变换 Scale: \[S(s_x,s_y) =\begin{pmatrix} s_x &0 &0\\ 0 & s ...

  7. SpringCloud之服务降级

    1.Hystrix(断路器) 1.1定义 扇出:多个微服务调用的时候,假设微服务A调用微服务B和C,微服务B和C又调用其他的服务.服务雪崩:如果扇出的链路上某个微服务的调用时间过长或不可用,对微服务A ...

  8. Java并发之ThreadPoolExecutor源码解析(三)

    Worker 先前,笔者讲解到ThreadPoolExecutor.addWorker(Runnable firstTask, boolean core),在这个方法中工作线程可能创建成功,也可能创建 ...

  9. Kubernetes-3.安装

    docker version:19.03.14 kubernetes version:1.19.4 本文介绍使用kubeadm安装Kubernetes集群的简单过程. 目录 使用kubeadm安装k8 ...

  10. sqlyog如何增删改查?

    转: sqlyog如何增删改查? 下面是一道完整的 sqlyog 增删改查的练习, 顺着做下去,可以迅速掌握. 1. 创建部门表dept,并插入数据: 2. 创建emp员工表,并插入数据: sql 代 ...