kubernetes1.16安装dashboard2.0

背景:由于之前本地部署的k8s当时由于条件限制,只在一台32G的主机上装安装vmware,并在上面安装虚拟机,每个虚拟机只有8G内存,稍微跑点东西就卡住了,这段时间在领导的支持下买了三台32G的组装机,用于部署本地测试环境。部署完1.16后才发现,1.16开始有一些变化,按照以前的yaml编排文件和img镜像要会报rbac权限 问题,由于对K8s并不是很精通,在折腾两天后终于安装上了,废话不多说,看下文:
1、直接 kubectl apply google上面搜索到的一个yaml编排文件
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
2、直接 使用这个编排文件不需要任何配置就可以部署成功,部署完成 后修改service,对外爆露端口才能用浏览器进行访问
---
---
kubectl -n kubernetes-dashboard edit svc kubernetes-dashboard 
spec:
clusterIP: 10.0.0.38
externalTrafficPolicy: Cluster
ports:
nodePort: 30220
    port: 443
    protocol: TCP
    targetPort: 8443
selector:
    k8s-app: kubernetes-dashboard
sessionAffinity: None
type: NodePort
---

3、获取token用于在浏览器访问时的验证

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk ‘{print $1}‘)
---
Data
====
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6IlNHRWkyUEdUNzJQLVRGWXJUczNUWF8xbEpDUDktLUJ0YjZuUEZ4M2dpc1EifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJuZ2lueC1pbmdyZXNzLXNlcnZpY2VhY2NvdW50LXRva2VuLW1iZnM1Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6Im5naW54LWluZ3Jlc3Mtc2VydmljZWFjY291bnQiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiI4NGZhNTU5Ni1iMTBjLTQ3YjktODhmMy01YjFhY2EzYTcwOTAiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06bmdpbngtaW5ncmVzcy1zZXJ2aWNlYWNjb3VudCJ9.c8uSX7MseuXpk87IVvLnIHiwthUTgh4k9Fivp9Wt2ZwXm3uhemPGiSE6sqI7Yiku4gDCl5z43TAtTnuneoRIpJ6g7olvicy2ta0b8FqIxvs9HX9WbcJUd0uxjjS1nMnM-pbadYY7Zpzd7UT41kKUti0Q5iWxKA_xBsvuLCZdgSDyk-QBWrQYyUswjMePi79LXuKx7qxQe2Kw1tLndBWdB0PJBT46KUyDYgVMsQEyFAufQ66hrdZ4jGXcA9XzLgC5Q4iuZ5380L48YsuppSPQFiJ9T3lCXH28mEKZHaCU-978XLBhy1Pmd52qAwXOhiJNm-_1qED8CufYqdxR2Ancsg
ca.crt:     1354 bytes
namespace:  11 bytes
---

4、使用浏览器进行访问,粘贴上面得到的token
kubernetes1.16安装dashboard2.0

kubernetes1.16安装dashboard2.0

上一篇:sql server静默安装/无人值守安装(sql server2016)


下一篇:.NET 5.0 RC1 发布,离正式版发布仅剩两个版本