因为自k8s 1.6之后,有基于角色的安全性。

所以很多网上以前的教程就不能使用了。

结合以下三个文档,暂时实现了dashboard界面的推出。

http://blog.csdn.net/jinzili777/article/details/73550687

http://m.dockerinfo.net/4468.html

https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml

=============

kubernetes-dashboard-rbac.yaml

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: dashboard-admin
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: default
  namespace: kube-system

kubernetes-dashboard.yaml

# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Configuration to deploy release version of the Dashboard UI compatible with
# Kubernetes 1.6 (RBAC enabled).
#
# Example usage: kubectl create -f <this_file>

apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: kubernetes-dashboard
  labels:
    k8s-app: kubernetes-dashboard
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: kubernetes-dashboard
  namespace: kube-system
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      k8s-app: kubernetes-dashboard
  template:
    metadata:
      labels:
        k8s-app: kubernetes-dashboard
    spec:
      containers:
      - name: kubernetes-dashboard
        image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.6.1
        ports:
        - containerPort: 9090
          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://my-address:port
        livenessProbe:
          httpGet:
            path: /
            port: 9090
          initialDelaySeconds: 30
          timeoutSeconds: 30
      serviceAccountName: kubernetes-dashboard
      # Comment the following tolerations if Dashboard must not be deployed on master
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
---
kind: Service
apiVersion: v1
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kube-system
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 9090
  selector:
    k8s-app: kubernetes-dashboard

在获得了相关的IP和端口之后,通过kubectl proxy命令打开端口。

kubectl proxy --address='12.3.1' --port=8086 --accept-hosts='^*$'

在k8s 1.7.0上启用dashboard的注意事项的更多相关文章

  1. 分布式存储系统之Ceph集群启用Dashboard及使用Prometheus监控Ceph

    前文我们了解了Ceph之上的RadosGW基础使用相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/16768998.html:今天我们来聊一聊Ceph启 ...

  2. 在Windows服务器上启用TLS 1.2及TLS 1.2基本原理

    在Windows服务器上启用TLS 1.2及TLS 1.2基本原理 在Windows服务器上启用TLS 1.2及TLS 1.2基本原理 最近由于Chrome40不再支持SSL 3.0了,GOOGLE认 ...

  3. 在centos服务器上启用ipv6地址

    随着互联网世界日新月异的发展,ipv6好像已经成为一种必不可少的趋势,但是当前国内机房大部分还不能支持ipv6,腾讯云亦如此.同时,现在有部分程序在服务器上运行的时候,需要服务器能监听一个ipv6地址 ...

  4. 如何在CentOS或者RHEL上启用Nux Dextop仓库 安装shutter截图工具

    Nux Dextop是一个面对CentOS.RHEL.ScientificLinux的含有许多流行的桌面和多媒体相关的包的第三方RPM仓库(比如:Ardour,Shutter等等).目前,Nux De ...

  5. IIS 6.0上部署ASP.NET MVC2.0

    在IIS7.5及8.0上部署都没有成功,对于身份验证会出现问题,据说是要安装什么东西,在这里说下IIS6.0的配置吧,下面是使用.net 4.0,自己可以选择所需的版本. 再此之前先确定web是用到了 ...

  6. Loadrunner11无法在win7 64位上启用ie解决办法

    Loadrunner11无法在win7 64位上启用ie解决办法 1.loadrunner11在win7 64位上默认启用的是32位的那个IE浏览器,路径:C:\Program Files (x86) ...

  7. 不要在linux上启用net.ipv4.tcp_tw_recycle参数

    不要在linux上启用net.ipv4.tcp_tw_recycle参数 发布于 2015/07/27 莿鸟栖草堂 本文为翻译英文BLOG<Coping with the TCP TIME-WA ...

  8. [转帖]k8s 基本使用(上)

    k8s 基本使用(上) https://www.jianshu.com/p/8d60ce1587e1 本文将介绍 k8s 中的一些最基本的命令,并辅以解释一些基本概念来方便理解,也就是说,本文是一篇偏 ...

  9. 如何在CentOS / RHEL 7上启用IPv6

    默认情况下,在RHEL / CenOS 7系统上启用IPv6.因此,如果故意在系统上禁用IPv6,则可以通过以下任一方法重新启用它. 1.在内核模块中启用IPv6(需要重启)2.使用sysctl设置启 ...

随机推荐

  1. ASP.NET基础学习(暴力破解密码)

    首先写出一段登陆程序: //ashx端 <%@ WebHandler Language="C#" Class="AddCalation" %> us ...

  2. java将文件转为UTF8工具类

    package hiveTest; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File ...

  3. 【BZOJ1043】下落的圆盘 [计算几何]

    下落的圆盘 Time Limit: 10 Sec  Memory Limit: 162 MB[Submit][Status][Discuss] Description 有n个圆盘从天而降,后面落下的可 ...

  4. 基本控件文档-UISwitch属性---iOS-Apple苹果官方文档翻译

    本系列所有开发文档翻译链接地址:iOS7开发-Apple苹果iPhone开发Xcode官方文档翻译PDF下载地址 //转载请注明出处--本文永久链接:http://www.cnblogs.com/Ch ...

  5. arduino 用电位器调节LED闪烁频率

    int dianwei; int led = 13; void setup() {  // put your setup code here, to run once:  Serial.begin(9 ...

  6. 第一章: 文件句柄转化为 typeglob/glob 与文件句柄检测

    #为了使在子例程中传递文件句柄不出问题 #我们要把文件句柄转为glob或typeglob #转为glob $fd = *MY_FILE; #转为typeblog $fd = \*MY_FILE; #两 ...

  7. python基础===Character string

    本文转自:python之Character string 1.python字符串 字符串是 Python 中最常用的数据类型.我们可以使用引号('或")来创建字符串,l Python不支持单 ...

  8. redis线程安全性

    总体来说快速的原因如下: 1)绝大部分请求是纯粹的内存操作(非常快速) 2)采用单线程,避免了不必要的上下文切换和竞争条件 3)非阻塞IO 内部实现采用epoll,采用了epoll+自己实现的简单的事 ...

  9. sicily 1036. Crypto Columns

    Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description The columnar encryption scheme scram ...

  10. sicily 1020. Big Integer

    Description Long long ago, there was a super computer that could deal with VeryLongIntegers(no VeryL ...