首页 > Web开发 > 详细

Kubernetes v1.10----部署kubernetes-dashboard v1.83

时间:2018-04-07 00:27:04      阅读:864      评论:0      收藏:0      [点我收藏+]

Kubernetes v1.10----部署kubernetes-dashboard v1.83

 

1.下载 kubernetes-dashboard  yaml文件

#因为文件中的image指定的是谷歌,所以不能直接使用apply进行部署

wget https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

修改iamge

kubernetes-dashboard.yaml

....
    spec:
      serviceAccountName: kubernetes-dashboard
      containers:
      - name: kubernetes-dashboard
        image: registry.cn-shenzhen.aliyuncs.com/rancher_cn/kubernetes-dashboard-amd64:v1.8.3 
....

wq保存

2.编辑 kubernetes-rbac.yaml 文件用于之后的用户认证

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

---

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

3.添加用户 

vim /etc/kubernetes/pki/basic_auth_file

技术分享图片

 

 4.修改kube-apiserver配置

vim /etc/kubernetes/manifests/kube-apiserver.yaml

spec:
  containers:
  - command:
    - kube-apiserver
    ...
    - --anonymous-auth=false
    - --insecure-bind-address=127.0.0.1
    - --insecure-port=8080
    - --basic-auth-file=/etc/kubernetes/pki/basic_auth_file
    ...

livenessProbe:
      failureThreshold: 8
      httpGet:
        host: 127.0.0.1
        path: /healthz
        port: 8080
        scheme: HTTP

  

5.重启服务

systemctl restart kubelet

验证服务是否正常

技术分享图片

 

6.安装dashboard

分别执行

kubectl apply -f kubernetes-dashboard.yaml
kubectl apply -f kubernetes-rbac.yaml
kubectl create clusterrolebinding login-dashboard-admin --clusterrole=cluster-admin --user=admin

7.查看服务是否运行

技术分享图片

 

8.访问

https://master:6443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

 技术分享图片

 

 

10.登陆验证

输入刚才我们在文件当中的用户名:admin 密码:admin 点击登陆,成功。

Kubernetes v1.10----部署kubernetes-dashboard v1.83

原文:https://www.cnblogs.com/heweiblog/p/8729465.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!