多节点部署k8s(7):创建dashboard的UI界面
转接上文:多节点部署k8s(6):多节点-nginx+keepalived一、准备环境[root@k8s-master1 k8s页面]# lsdashboard-configmap.yamldashboard-rbac.yamldashboard-service.yamldashboard-controller.yamldashboard-secret.yaml...
·
转接上文:多节点部署k8s(6):多节点-nginx+keepalived
一、准备环境
[root@k8s-master1 k8s页面]# ls
dashboard-configmap.yaml dashboard-rbac.yaml dashboard-service.yaml
dashboard-controller.yaml dashboard-secret.yaml k8s-admin.yaml
二、创建页面,顺序一定要注意
#授权访问api
[root@k8s-master1 k8s页面]# kubectl create -f dashboard-rbac.yaml
role.rbac.authorization.k8s.io/kubernetes-dashboard-minimal created
rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard-minimal created
#进行加密
[root@k8s-master1 k8s页面]# kubectl create -f dashboard-secret.yaml
secret/kubernetes-dashboard-certs created
secret/kubernetes-dashboard-key-holder created
#配置应用
[root@k8s-master1 k8s页面]# kubectl create -f dashboard-configmap.yaml
configmap/kubernetes-dashboard-settings created
#控制器
[root@k8s-master1 k8s页面]# kubectl create -f dashboard-controller.yaml
serviceaccount/kubernetes-dashboard created
deployment.apps/kubernetes-dashboard created
[root@k8s-master1 k8s页面]# kubectl create -f dashboard-service.yaml
service/kubernetes-dashboard created
#查看创建在指定的kube-system命名空间下
[root@k8s-master1 k8s页面]# kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
kubernetes-dashboard-65f974f565-7sk49 1/1 Running 0 99s
[root@k8s-master1 k8s页面]# kubectl get pods,svc -n kube-system
NAME READY STATUS RESTARTS AGE
pod/kubernetes-dashboard-65f974f565-7sk49 1/1 Running 0 2m32s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes-dashboard NodePort 10.0.0.136 <none> 443:30001/TCP 108s
三、登录页面
https://192.168.100.40:30001/
#生成令牌
[root@k8s-master1 k8s页面]# kubectl create -f k8s-admin.yaml
serviceaccount/dashboard-admin created
clusterrolebinding.rbac.authorization.k8s.io/dashboard-admin created
[root@k8s-master1 k8s页面]# kubectl get secret -n kube-system
NAME TYPE DATA AGE
dashboard-admin-token-tpbnt kubernetes.io/service-account-token 3 27s
default-token-h94dv kubernetes.io/service-account-token 3 2d5h
kubernetes-dashboard-certs Opaque 0 86m
kubernetes-dashboard-key-holder Opaque 2 86m
kubernetes-dashboard-token-x9f9h kubernetes.io/service-account-token 3 85m
#查看令牌
[root@k8s-master1 k8s页面]# kubectl describe secret dashboard-admin-token-tpbnt -n kube-system
Name: dashboard-admin-token-tpbnt
Namespace: kube-system
Labels: <none>
Annotations: kubernetes.io/service-account.name: dashboard-admin
kubernetes.io/service-account.uid: 0a10325a-8413-11ea-bc00-000c29424dbd
Type: kubernetes.io/service-account-token
Data
====
namespace: 11 bytes
token: eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkYXNoYm9hcmQtYWRtaW4tdG9rZW4tdHBibnQiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGFzaGJvYXJkLWFkbWluIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiMGExMDMyNWEtODQxMy0xMWVhLWJjMDAtMDAwYzI5NDI0ZGJkIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmRhc2hib2FyZC1hZG1pbiJ9.Mmh6lVKeU8vM0oNwtdvqvTLuOH1rcKpqnY0g4uXjPcGrhC6N_-5VzoCZ4OZXQheDQ6yiq-FLfaohC0nBh9xi55mmHqmRj-TgspAB0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o2A2FslSiL_d_ZeaFYIEhx9NahKxPhBEJPkMb5cqdyetTb1zZvBg1Miz9ZHkOQf-xMza_MFQR0Hw
转接下文:多节点部署k8s(8):解决谷歌UI界面
更多推荐
已为社区贡献7条内容
所有评论(0)