In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Background of installation and configuration of Kubernetes Dashboard
After quickly completing the installation of kubernetes through kubeadm, you can quickly experience the powerful features of kubernetes. The only drawback is that it can only be viewed or manipulated through commands, and there is no intuitive and concise Web UI to feel the joy of success. In addition, the domestic network environment has also increased some thresholds to some extent. In the face of all this, there are still ways to experience kunernetes dashboard.
Two operating steps
Because it is not clear which Node Pod will be dispatched to, execute the following script on each node:
#! / bin/bashdocker pull registry.cn-qingdao.aliyuncs.com/wangxiaoke/kubernetes-dashboard-amd64:v1.10.0# docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.10.0docker tag registry.cn-qingdao.aliyuncs.com/wangxiaoke/kubernetes-dashboard-amd64:v1.10.0 k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0docker image rm registry.cn-qingdao.aliyuncs.com/wangxiaoke/kubernetes-dashboard-amd64:v1.10.0
Execute on the Master node:
[root@k8s-m ~] # curl-O kubectl apply-f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.0/src/deploy/recommended/kubernetes-dashboard.yaml[root@k8s-m ~] # kubectl apply-f kubernetes-dashboard.yaml
Check to see if the pod is created successfully:
[root@k8s-m] # kubectl get pods-- namespace=kube-systemNAME READY STATUS RESTARTS AGEcoredns-576cbf47c7-xg4xm 1 Running 1 72mcoredns-576cbf47c7-xq9mc 1 Running 1 80metcd-k8s-m 1 Running 2 79mkube-apiserver-k8s-m 1 Running 2 79mkube-controller-manager-k8s-m 1 Running 21 80mkube-flannel-ds-amd64-9fzm7 1 Running 1 72mkube-flannel-ds-amd64-nddqf 1 Running 2 72mkube-proxy-6js29 1/1 Running 2 80mkube-proxy-lp2v2 1/1 Running 2 72mkube-scheduler-k8s-m 1/1 Running 19 80mkubernetes-dashboard-77fd78f978-ngkvb 1/1 Running 1 25m
Modify the service configuration, find type, and change ClusterIP to NodePort:
[root@k8s-m] # kubectl edit service kubernetes-dashboard-- namespace=kube-system
View exposed ports:
[root@k8s-m] # kubectl get service-- namespace=kube-systemNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEkube-dns ClusterIP 10.96.0.10 53 Universe 87mkubernetes-dashboard NodePort 10.101.204.129 443:31269/TCP 32m
To create a kubernetes-dashboard user:
Kind: ClusterRoleBindingapiVersion: rbac.authorization.k8s.io/v1beta1metadata: name: admin annotations: rbac.authorization.kubernetes.io/autoupdate: "true" roleRef: kind: ClusterRole name: cluster-admin apiGroup: rbac.authorization.k8s.iosubjects:- kind: ServiceAccount name: admin namespace: kube-system---apiVersion: v1kind: ServiceAccountmetadata: name: admin namespace: kube-system labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile
Create a user:
[root@k8s-m] # kubectl create-f admin-token.yaml
Get login token:
[root@k8s-m ~] # kubectl get secret-n kube-system | grep admin | awk'{print $1} 'admin-token-6tkxm [root@k8s-m ~] # kubectl describe secret admin-token-6tkxm-n kube-system | grep' ^ token' | awk'{print $2} 'eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi10b2tlbi02dGt4bSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJhZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjQ4MjcxNTE5LTFkODgtMTFlOS1iMGZkLTAwMTU1ZDc0ZWUyNyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTphZG1pbiJ9.TpBGEd-7VXrYjN_5fi0sOXMqLIrhDkgqIVVTagO4wvKOQloCJkpfvnVgBJ0Oi52-UQNBKBVH8v1wRBltPHKrjMqVU9re6-y3nd4UbwWtIZzmfMJ_oRwo2ne_UdU_Ya2I5EOH3qh2cUIhdG3NpZYXwFICsNZURJWZM_U7OqJrZPuMXw4sfD6iGRWeMtOiAI8YN1LAfpj1RHaeOa66DK_LEsSLBsb2W6m7wrugk7SBCJSkMyec7ZVGLHo5Ha-X5wNO5qAAKzud0lz2KVcvwJW8lkcc9_lPxPIoDIpdCFEoG5xZHr0B2PkatCS8f31VQzP6LAmvkmHxbENb6V3Ov90RGw
Copy the above content for backup.
3. View the results
3.1 Open the browser and enter the access address:. Enter the access address of Node-2 here, and the same is true for other nodes. As shown below:
3.2 Select the password for authentication, and enter the token you just obtained to log in successfully.
3.3 after a successful login, as shown below:
Four summaries
4.1 this is a simple and happy process, as long as you start to do it, it is actually very simple!
4.2 this experiment is deployed on kubernetes v1.12.1.
4.3 the browser used in the experiment is Firefox v64.0.2, which may not be supported by other browsers.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.