k8s安装之dashboard
dashboard
wget https://storage.googleapis.com/kubernetes-release/release/v1.11.0/kubernetes-server-linux-amd64.tar.gz tar -xzvf kubernetes-server-linux-amd64.tar.gz cd kubernetes tar -zxf kubernetes-src.tar.gz cd cluster/addons/dashboard cp *.yaml ~/dashboard/ #####修改配置文件 cat dashboard-service.yaml apiVersion: v1 kind: Service metadata: name: kubernetes-dashboard namespace: kube-system labels: k8s-app: kubernetes-dashboard kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile spec: selector: k8s-app: kubernetes-dashboard type: NodePort ###此处为添加 ports: - port: 443 targetPort: 8443 #####修改kube-apiserver.service --anonymous-auth=false \ # 不接受匿名访问,若为true,则表示接受,此处设置为false,便于dashboard访问 --basic-auth-file=/etc/kubernetes/basic_auth_file 新建/etc/kubernetes/basic_auth_file文件,并在其中添加: admin,admin,1002 #####启动 kubectl apply -f . #####权限 kubectl create clusterrolebinding login-dashboard-admin --clusterrole=cluster-admin --user=admin #####获取token kubectl -n kube-system create sa dashboard kubectl create clusterrolebinding dashboard --clusterrole cluster-admin --serviceaccount=kube-system:dashboard SECRET=$(kubectl -n kube-system get sa dashboard -o yaml | awk ‘/dashboard-token/ {print $3}‘) kubectl -n kube-system describe secrets ${SECRET} | awk ‘/token:/{print $2}‘ 测试 https://172.16.20.206:6443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
相关推荐
技术积累LZ 2020-07-28
liaochaowu 2020-06-12
matthewhan 2020-06-08
wishli 2020-05-28
JustHaveTry 2020-05-11
guan000 2020-05-09
Leonwey 2020-05-07
chognzhihongseu 2020-05-01
guan000 2020-02-17
hubanbei00的家园 2020-02-10
kjh00abc 2020-01-29
CurrentJ 2020-01-23
topswim 2020-01-11
kjh00abc 2020-01-08
CurrentJ 2020-01-09
CurrentJ 2020-01-07
yibuchen 2019-11-21
小火车 2019-11-10