配置kubernetes的dashboard相对简单。同样的,只需要从源码中获取到dashboard-controller.yaml及dashboard-service.yaml文件,稍加修改即可:

wget https://rawgit.com/kubernetes/kubernetes/master/cluster/addons/dashboard/dashboard-controller.yaml
wget https://rawgit.com/kubernetes/kubernetes/master/cluster/addons/dashboard/dashboard-service.yaml

修改dashboard-controller.yaml如下:

kind: Deployment
apiVersion: extensions/v1beta1
metadata:
labels:
app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
replicas:
revisionHistoryLimit:
selector:
matchLabels:
app: kubernetes-dashboard
template:
metadata:
labels:
app: kubernetes-dashboard
# Comment the following annotation if Dashboard must not be deployed on master
annotations:
scheduler.alpha.kubernetes.io/tolerations: |
[
{
"key": "dedicated",
"operator": "Equal",
"value": "master",
"effect": "NoSchedule"
}
]
spec:
containers:
- name: kubernetes-dashboard
image: myhub.fdccloud.com/library/kubernetes-dashboard-amd64:v1.5.1
imagePullPolicy: Always
ports:
- containerPort:
protocol: TCP
args:
# Uncomment the following line to manually specify Kubernetes API server Host
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
     #额外增加
- --apiserver-host=http://10.5.10.116:8080
livenessProbe:
httpGet:
path: /
port:
initialDelaySeconds:
timeoutSeconds:

dashboard-service.yaml不需要修改,这里直接给出源码中的示例文件:

kind: Service
apiVersion: v1
metadata:
labels:
app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
type: NodePort
ports:
- port:
targetPort:
selector:
app: kubernetes-dashboard

执行启动即可:

kubectl create -f dashboard-controller.yaml
kubectl create -f dashboard-service.yaml

启动后,可以通过如下指令查看映射的nodeport:

[root@server- kubernetes]# kubectl get svc --namespace=kube-system
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns 10.254.0.100 <none> /UDP,/TCP 5h
kubernetes-dashboard 10.254.68.60 <nodes> :/TCP 1d

以下访问地址皆可用于访问:

http://10.5.10.116:8080/ui

http://10.5.10.116:30097

dashboard界面如图:

错误说明:

在实际的配置过程中,发现dashboard无法启动,通过kubectl logs 查看pod日志,如下:

Using HTTP port:
Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigurhas invalid apiserver certificates or service accounts configuration) or the --apiserver-host param points to a ser not exist. Reason: invalid configuration: no configuration has been provided
Refer to the troubleshooting guide for more information: https://github.com/kubernetes/dashboard/blob/master/docs/uubleshooting.md

这个错误,就是因为需要在dashboard启动的args参数里加上如下参数:

--apiserver-host=http://10.5.10.116:8080

另外,我们发现这个dashboard的访问没有任何的认证与授权机制,后续会专门对kubernetes的认证机制做相关说明。

Kubernetes 1.5 配置dashboard的更多相关文章

  1. Centos7部署Kubernetes集群(单工作节点)+配置dashboard可视化UI

    目标:docker+kubernetes+cadvosor+dashboard 一:物理硬件 两台虚拟机(centos7):一台做为主节点(master),一台做为工作节点(node) [root@M ...

  2. 基于kubernetes集群部署DashBoard

    目录贴:Kubernetes学习系列 在之前一篇文章:Centos7部署Kubernetes集群,中已经搭建了基本的K8s集群,本文将在此基础之上继续搭建K8s DashBoard. 1.yaml文件 ...

  3. kubernetes实践之二:Kubernetes可视WEB UI Dashboard搭建

    Kubernetes可视WEBUI Dashboard搭建 支持浏览器:火狐 一.Dashboard下载地址 git clone https://github.com/kubernetes/kuber ...

  4. Kubernetes ServiceAccount的配置

    开始配置Kubernetes集群的时候为了少出问题,都是在apiserver配置中去掉ServiceAccount采用非安全连接的方式,但在后面配置FEK日志的过程中,很多时候绕不开这个安全机制,但因 ...

  5. 10-部署配置dashboard插件

    配置和安装 dashboard 官方文件目录:kubernetes/cluster/addons/dashboard 我们需要使用的yaml文件 $ ls *.yaml dashboard-contr ...

  6. Centos7.2/7.3集群安装Kubernetes 1.8.4 + Dashboard(转)

    原文https://www.cnblogs.com/burningTheStar/p/7865998.html 1.环境配置 结点数量:3 结点系统:CentOS 7.2 / 7.3 2.效果展示 3 ...

  7. kubernetes Traefik ingress配置详解

    理解Ingress 简单的说,ingress就是从kubernetes集群外访问集群的入口,将用户的URL请求转发到不同的service上.Ingress相当于nginx.apache等负载均衡方向代 ...

  8. kubernetes实战篇之dashboard搭建

    系列目录 kubernetes dashboard是kubernetes官方提供的web管理界面,通过dashboard可以很方便地查看集群的各种资源.以及修改资源编排文件,对集群进行扩容操作,查看日 ...

  9. 019.Kubernetes二进制部署插件dashboard

    一 修改配置文件 1.1 下载解压 [root@k8smaster01 ~]# cd /opt/k8s/work/kubernetes/ [root@k8smaster01 kubernetes]# ...

随机推荐

  1. dubbo实际应用中的完整的pom.xml

    http://blog.csdn.net/rodjohnsondoctor/article/details/39030601

  2. 任务看板-Monday

    工作照

  3. Task 9 从用户界面和体验分析“360极速浏览器”

    我目前使用的浏览器是360极速浏览器,下面将针对用户界面.记住用户选择.短期刺激.长期使用的好处坏处.不要让用户犯简单的错误四个方面对其进行评估: 1.用户界面: 01 可视性原则--网络没有连接或者 ...

  4. spring 原理

    1.spring原理 内部最核心的就是IOC了,动态注入,让一个对象的创建不用new了,可以自动的生产,这其实就是利用java里的反射,反射其实就是在运行时动态的去创建.调用对象,Spring就是在运 ...

  5. linshi18

    #include<iostream> using namespace std; int n,m,k; #define max 100 char mmap[max][max]; int mm ...

  6. struts2返回List json

    利用struts2-json-plugin 之前一直输出null.... 按网上的配也不行 后来不知道怎么突然可以了 赶紧记录一下 private List<Shop> moneyshop ...

  7. 树莓派与Arduino Leonardo使用NRF24L01无线模块通信之基于RF24库 (一) 配置与测试

    引脚连接说明 与树莓派的连线 NRF24L01 => 树莓派 GND          =>   GND VCC          =>    3.3V CE           = ...

  8. Gradle入门(2):构建简介

    基本概念 在Gradle中,有两个基本概念:项目和任务.请看以下详解: 项目是指我们的构建产物(比如Jar包)或实施产物(将应用程序部署到生产环境).一个项目包含一个或多个任务. 任务是指不可分的最小 ...

  9. Jenkins权限控制-Role Strategy Plugin插件使用

    Role Strategy Plugin插件可以对构建的项目进行授权管理,让不同的用户管理不同的项目,将测试和生产环境分开. 具体配置方法如下(操作需要管理员用户权限). Jenkins版本:1.64 ...

  10. label上的事件操作执行两次

    label上的事件执行两次 标签(空格分隔): 事件执行两次 今天在做公司项目的过程中,需要在表单元素单选框上绑定事件,执行相应的操作,结果发现事件执行了两次 具体代码: <div class= ...