【k8s第三步】Kubernetes-Dashboard仪表盘【已修正错误】
⒈下载描述文件
wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta6/aio/deploy/recommended.yaml
⒉在主节点上运行
kubectl apply -f recommended.yaml
⒊查看相关pod
kubectl get pod -n kubernetes-dashboard -o wide
⒋查看相关服务
kubectl get service -n kubernetes-dashboard
*如果启动不成功可以执行以下命令删除
kubectl delete ns kubernetes-dashboard
⒌开启代理
kubectl proxy
⒍访问web地址
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/.
⒎官方Github上有创建用户的例子,我这里就不详细赘述了。
https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md
打开上面我们下载的yaml资源文件就可以看到,官方资源文件中有为我们提供一个名为kubernetes-dashboard的用户
--- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubernetes-dashboard
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kubernetes-dashboard --- kind: Deployment
apiVersion: apps/v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
replicas:
revisionHistoryLimit:
selector:
matchLabels:
k8s-app: kubernetes-dashboard
template:
metadata:
labels:
k8s-app: kubernetes-dashboard
spec:
containers:
- name: kubernetes-dashboard
image: kubernetesui/dashboard:v2.0.0-beta6
imagePullPolicy: Always
ports:
- containerPort:
protocol: TCP
args:
- --auto-generate-certificates
- --namespace=kubernetes-dashboard
# 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
volumeMounts:
- name: kubernetes-dashboard-certs
mountPath: /certs
# Create on-disk volume to store exec logs
- mountPath: /tmp
name: tmp-volume
livenessProbe:
httpGet:
scheme: HTTPS
path: /
port:
initialDelaySeconds:
timeoutSeconds:
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser:
runAsGroup:
volumes:
- name: kubernetes-dashboard-certs
secret:
secretName: kubernetes-dashboard-certs
- name: tmp-volume
emptyDir: {}
serviceAccountName: kubernetes-dashboard
nodeSelector:
"beta.kubernetes.io/os": linux
# 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: dashboard-metrics-scraper
name: dashboard-metrics-scraper
namespace: kubernetes-dashboard
spec:
ports:
- port:
targetPort:
selector:
k8s-app: dashboard-metrics-scraper --- kind: Deployment
apiVersion: apps/v1
metadata:
labels:
k8s-app: dashboard-metrics-scraper
name: dashboard-metrics-scraper
namespace: kubernetes-dashboard
spec:
replicas:
revisionHistoryLimit:
selector:
matchLabels:
k8s-app: dashboard-metrics-scraper
template:
metadata:
labels:
k8s-app: dashboard-metrics-scraper
annotations:
seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
spec:
containers:
- name: dashboard-metrics-scraper
image: kubernetesui/metrics-scraper:v1.0.1
ports:
- containerPort:
protocol: TCP
livenessProbe:
httpGet:
scheme: HTTP
path: /
port:
initialDelaySeconds:
timeoutSeconds:
volumeMounts:
- mountPath: /tmp
name: tmp-volume
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser:
runAsGroup:
serviceAccountName: kubernetes-dashboard
nodeSelector:
"beta.kubernetes.io/os": linux
# Comment the following tolerations if Dashboard must not be deployed on master
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
volumes:
- name: tmp-volume
emptyDir: {}
让我们拿到这个用户令牌进行登录,执行一下命令
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep kubernetes-dashboard | awk '{print $1}')
得到下面的结果
Name: kubernetes-dashboard-certs
Namespace: kubernetes-dashboard
Labels: k8s-app=kubernetes-dashboard
Annotations:
Type: Opaque Data
==== Name: kubernetes-dashboard-csrf
Namespace: kubernetes-dashboard
Labels: k8s-app=kubernetes-dashboard
Annotations:
Type: Opaque Data
====
csrf: bytes Name: kubernetes-dashboard-key-holder
Namespace: kubernetes-dashboard
Labels: <none>
Annotations: <none> Type: Opaque Data
====
priv: bytes
pub: bytes Name: kubernetes-dashboard-token-jlgrx
Namespace: kubernetes-dashboard
Labels: <none>
Annotations: kubernetes.io/service-account.name: kubernetes-dashboard
kubernetes.io/service-account.uid: 08975c17-e411-4cc3-925e-6ab23de2d698 Type: kubernetes.io/service-account-token Data
====
ca.crt: bytes
namespace: bytes
token: eyJhbGciOiJSUzI1NiIsImtpZCI6Ikt6bVM4VFZQMm9ZZFJ3d2tlM0hLczlFZmFldjdmeFJfZnpISkR4dW15eGMifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZC10b2tlbi1qbGdyeCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjA4OTc1YzE3LWU0MTEtNGNjMy05MjVlLTZhYjIzZGUyZDY5OCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlcm5ldGVzLWRhc2hib2FyZDprdWJlcm5ldGVzLWRhc2hib2FyZCJ9.qsiB0fqmSXUGRd7u2HyLD1SReLacjeKck-7o5klSudcjzthrEvNt0sbuvggI9GhwKyp0vuxnDcQTFHTSdyDtf-cuLyjfI6lBiufVNmd4ArZwlf7V4u673MB-yNANry3wJfY1Sk-ijIFBYXWyiESiTR4oAWPTi6-7Eee9kPalTFGcD0k5f_VasfWzT2PzONbaxH98q9oFUbx5kFK86Xkw-BgucwGwfUA_O9VjbCHYJOj3QpNd0VugFXzvCA7Cn9gXqEmkzS05uz3puVJPqfJ94ggV-XaIyuO7QxlEFJwoeIQ7gdfE6Wtgpgo3G_dVv8KXB9dNnaaWlyV45jJ2y64Idg
将token复制到登录令牌中进行登录即可
【k8s第三步】Kubernetes-Dashboard仪表盘【已修正错误】的更多相关文章
- 【k8s第二步】Kubernetes-Kubeadm部署安装【已修正错误】
⒈开启kube-proxy的ipvs的前置条件 模式改为lvs调度的方式,kube-proxy主要解决的是svc(service)与pod之间的调度关系,ipvs的调度方式可以极大的增加它的访问效率, ...
- 【k8s第一步】Kubernetes-Linux系统初始化【已修正错误】
⒈配置Linux的IP地址 vim /etc/sysconfig/network-scripts/ifcfg-ens33v ifcfg-ens33是网卡的最新命名规范,它会从BIOS => PC ...
- kubernetes dashboard 安装时出现9090: getsockopt: connection refused错误
转载于:https://blog.csdn.net/lucy06/article/details/79082302 安装kubernetes dashboard时,出现错误: Error: 'dia ...
- 微服务探索之路02篇liunx ubuntu服务器部署k8s(kubernetes)-kubernetes/dashboard
本章介绍所需环境:ubuntu18.04,建立在上一篇微服务探索之路01篇已经安装了docker的基础上. 1 替换k8s镜像源为国内镜像 进入目录 cd /etc/apt/sources.list. ...
- 30分钟学会Docker里面开启k8s(Kubernetes)登录仪表盘(图文讲解)
前言 我们之前搭建了第一个docker项目: windows环境30分钟从0开始快速搭建第一个docker项目(带数据库交互):https://www.cnblogs.com/xiongze520/p ...
- 三步升级已安装的 Android SDK 和 ADT 插件(转载)
转载:http://www.tfan.org/update-adt-and-android-sdk-in-five-minutes/ 如何快速地把已安装的 Android SDK 及 Eclipse ...
- kubernetes(K8S)集群及Dashboard安装配置
环境准备 机器信息 主机名 操作系统 IP地址 K8sm-218 Centos 7.5-x86_64 172.17.0.218 k8s-219 Centos 7.5-x86_64 172.17.0.2 ...
- 附004.Kubernetes Dashboard简介及使用
一 Kubernetes dashboard简介 1.1 Web UI简介 dashboard是基于Web的Kubernetes用户界面.可以使用dashboard将容器化应用程序部署到Kuberne ...
- kubernetes学习笔记之十一:kubernetes dashboard认证及分级授权
第一章.部署dashboard 作为Kubernetes的Web用户界面,用户可以通过Dashboard在Kubernetes集群中部署容器化的应用,对应用进行问题处理和管理,并对集群本身进行管理.通 ...
随机推荐
- PHP全栈学习笔记23
php,基础,流程控制,函数,字符串,数组,web交互,mysql数据库,PHP数据库编程,cookie与session,日期和时间,图形图形处理,文件和目录处理,面向对象,pdo数据库抽象层,sma ...
- 我需要关于fixedFluxPressure边界的解释【翻译】
翻译自:CFD-online 帖子地址:http://www.cfd-online.com/Forums/openfoam-solving/82581-i-need-explanations-abou ...
- 数据结构Java版之查找算法(三)
关于查找算法,这里只进行两个算法的说明.包括 顺序查找 和 折半查找. 顺序查找: 顺序查找常用于未排序的数据中.查找速度较慢,只能应用于较小的数据量. public int sequentialSe ...
- GC和GC分配策略
一.内存如何回收 解决如何回收问题,首先需要解决回收对象的问题?什么样的对象需要回收,怎么样的不需要回收?保证有引用的内存不被释放:回收没有指针引用的内存是Collector的职责,在保证没有指针引用 ...
- legend3---18、第一阶段代码完成
legend3---18.第一阶段代码完成 一.总结 一句话总结: 看起来麻烦或者自己因为厌烦不想做的,其实硬着头皮来做,一下子就做完了 1.layer_mobile的loading层和关闭loadi ...
- android.support.design库的引用和冲突解决
android.support.design库的引用和冲突解决 转 https://www.jianshu.com/p/2a0a2af9f2b4 最近在工程中使用到android.support.de ...
- PorterDuffXfermode之PorterDuff.Mode.MULTIPLY
package com.loaderman.customviewdemo.view; import android.content.Context; import android.graphics.B ...
- [Java复习] 分布式事务 Part 1
1. CAP理论 C: Consistency 一致性 A: Availability 可用性 P: Partition tolerance 分区容错性 CAP定理:一个分布式系统不可能同时满足CAP ...
- MySQL复制线程状态转变
一.主库线程状态(State)值 以下列表显示了主从复制中主服务器的Binlog Dump线程的State列中可能看到的最常见状态(SHOW PROCESSLIST).如果Binlog Dump线程在 ...
- 测试理论03-svn-缺陷及报告-jira
回顾--用例设计方法 边界值(三个点,使用步骤) 判定表(适用,四个组成部分,规则,使用) 因果图(适用,四个符号,使用) 正交表(定义,特性,L_n(m^k),因素,水平,使用,工具allpairs ...