Kubernetes Dashboard 安装与认证

1、安装dashboard

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml(images地址记得改掉,因为墙,你懂得)

1.2, 配置ingress 映像域名xxx.dashboard.qing.cn(必须是https)

2 、创建admin token

#cat dashboard-adminuser.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kube-system

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

#kubectl apply -f dashboard-adminuser.yaml
#kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk ‘{print $1}‘)

复制 token登陆即可

3、增加只读帐号token

#cat read-user-sa-rbac.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
name: dashboard-read-user
namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: dashboard-read-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: dashboard-read-clusterrole
subjects:
- kind: ServiceAccount
name: dashboard-read-user
namespace: kube-system

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: dashboard-read-clusterrole
rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- persistentvolumeclaims
- pods
- replicationcontrollers
- replicationcontrollers/scale
- serviceaccounts
- services
- nodes
- persistentvolumeclaims
- persistentvolumes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- bindings
- events
- limitranges
- namespaces/status
- pods/log
- pods/status
- replicationcontrollers/status
- resourcequotas
- resourcequotas/status
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- deployments/scale
- replicasets
- replicasets/scale
- statefulsets
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- deployments/scale
- ingresses
- networkpolicies
- replicasets
- replicasets/scale
- replicationcontrollers/scale
verbs:
- get
- list
- watch
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
- networkpolicies
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
- volumeattachments
verbs:
- get
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
- clusterroles
- roles
- rolebindings
verbs:
- get
- list
- watch

 

原文地址:https://www.cnblogs.com/Qing-840/p/10834199.html

时间: 2024-11-05 22:36:39

Kubernetes Dashboard 安装与认证的相关文章

kubernetes dashboard 安装

1.下载  dashboard.yaml文件 我安装的k8s版本为1.5.2,从github下载相近的dashaboard版本 wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.5.0/src/deploy/kubernetes-dashboard.yaml 2.编辑kubernetes-dashboard.yaml 由于yaml文件中的image使用的是谷歌gcr.io,被墙无法下载,因此,需将文件中image 用do

Kubernetes dashboard安装

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/

K8s+dashboard安装部署 不错

系统安装使用虚拟机安装两个centos系统,在/etc/hosts里增加两行192.168.140.128 kuber-master192.168.140.129 kuber-node1 关闭防火墙systemctl stop firewalld & systemctl disable firewalld 关闭selinuxsed -i ‘s/enforcing/disabled/’ /etc/selinux/configsetenforce 0 关闭swapswapoff -a #临时关闭vi

Kubernetes Dashboard的安装与配置

Kubernetes Dashboard的安装与配置 一 背景 通过kubeadm快速完成了kubernetes的安装,即可迅速地体验到kubernetes的强大功能.美中不足的是,只能通过命令来查看或操作,没有一个直观且简洁的Web UI来感受一下这种成功的喜悦.此外,国内的网络环境,也在某种程度上增加了一些门槛.面对如此种种,依然有办法体验kunernetes dashboard. 二 操作步骤 因为不清楚Pod会被调度到哪一个Node上,所以在每一个节点上执行以下脚本: #!/bin/ba

kubernetes dashboard 认证及分级授权

概述 前面介绍了kubernetes的两个东西,认证和授权 在kubernetes中我们对API server的一次访问大概会包含哪些信息?简单来讲它是restfule风格接口,也就是某个用户对某个操作执行了某个操作. subject --> action --> object 因此我们授权定义也是围绕这种方式展开的,同时我们也不能允许所有用户随意就能够访问我们k8s 所以我们讲到了认证,讲到了它的两种认证方式,第一种叫token,一种叫证书认证,即tls,当然还有第三种方式认证,账号和密码(

安装kubernetes dashboard

一.kubernetes dashboard kubernetes dashboard是k8s的web管理界面 二.安装 k8s的版本为1.5 1.创建dashboard-controller.yaml [[email protected] dashboard]# cat dashboard-controller.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: # Keep the name in sync with

kubernetes学习14—Dashboard搭建和认证

原文:kubernetes学习14-Dashboard搭建和认证 本文收录在容器技术学习系列文章总目录 一.介绍 Kubernetes Dashboard是Kubernetes集群的基于Web的通用UI.它允许用户管理在群集中运行的应用程序并对其进行故障排除,以及管理群集本身. 二.搭建dashboard 1.编写yaml文件 借鉴GitHub,修改了image的下载地址和pod的一些配置 [root@master ~]# vim dashboard.yaml # Filename: dashb

[k8s]kubernetes dashboard的安装

之前一直使用的是命令行,但是又觉得如果连控制台都还没有动手实践过会不会有点low 1.安装dashboard 参阅官网的安装方法,https://github.com/kubernetes/dashboard,安装很简单,如果慢可以使用其它的镜像网站,我这里使用的是mirrorgooglecontainers/kubernetes-dashboard-amd64,然后重新打了k8s.gcr.io/kubernetes-dashboard-amd64的tag 2.暴露服务 [email prote

Kubernetes Dashboard的安装与坑

1.前言 https://github.com/kubernetes/dashboard/releases kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml Kubernetes Dashboard is a general purpose, web-based UI for Kuberne