Kubernetes-dashboard安装

来自linux中国网wiki
Evan讨论 | 贡献2019年10月14日 (一) 13:48的版本 (导入1个版本)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索

ins

1.安装是一定要FQ
2. docker pull k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1

kubectl  get pod --all-namespaces

kubectl  describe pod kubernetes-dashboard-54fb766c84-cnj98 --namespace=kube-system


#开始安装
wget  https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/alternative/kubernetes-dashboard.yaml
kubectl  create -f kubernetes-dashboard.yaml 

kubectl --namespace=kube-system get deployment kubernetes-dashboard
NAME                   READY   UP-TO-DATE   AVAILABLE   AGE
kubernetes-dashboard   0/1     1            0           105s

kubernetes-dashboard   1/1     1            1           21m

#修改配置
evan@k8s-master:~$ kubectl --namespace=kube-system edit  service  kubernetes-dashboard
service/kubernetes-dashboard edited

type: ClusterIP --> type: NodePort

evan@k8s-master:~$ kubectl --namespace=kube-system get service  kubernetes-dashboard
NAME                   TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
kubernetes-dashboard   NodePort   10.102.158.92   <none>        80:30875/TCP   2m27s



 kubectl get secret --all-namespaces|grep dashboard
kube-system       kubernetes-dashboard-token-88d6q                 kubernetes.io/service-account-token   3      36m
evan@k8s-master:~$ kubectl describe secret/kubernetes-dashboard-token-88d6q -n kube-system 


有问题FQ delete 就行
kubectl  delete -f  https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/alternative/kubernetes-dashboard.yaml 


#权限配置

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

 kubectl apply -f dashboard-admin.yaml 
clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created

masterip:nodeport

usage

see also

在阿里云k8s服务中玩转最新版原生dashboard


kubernetes-dashboard(1.8.3)部署与踩坑


kubernetes-dashboard环境搭建

配置kubernetes UI图形化界面

从零开始搭建K8S--搭建K8S Dashboard