This is the 10th day of my participation in Gwen Challenge

Install the Dashboard

The Helm package management tool is used for installation.

Download Chart locally

[root@k8s-master helm]# helm pull stable/kubernetes-dashboard
[root@k8s-master helm]# ll kuber*
-rw-r--r--. 1 root root 8682 May 17 15:15 kubernetes-dashboard-1.10.1.tgz
Copy the code

The chart directory structure appears after decompression

[root@k8s-master helm]# cd kubernetes-dashboard
[root@k8s-master kubernetes-dashboard]# ll
total 28
-rwxr-xr-x. 1 root root   468 Jan  1  1970 Chart.yaml
-rwxr-xr-x. 1 root root 12858 Jan  1  1970 README.md
drwxr-xr-x. 2 root root   264 May 17 15:28 templates
-rwxr-xr-x. 1 root root  5470 Jan  1  1970 values.yaml

Copy the code

Modify the values.yaml file

Yaml = values-xiaofu. Yaml = values-xiaofu. Yaml = values-xiaofu

Image: the repository: registry.cn-shanghai.aliyuncs.com/zdl_work/kubernetes-dashboard-amd64 tag: v1.10.1 ingress: enabled: true annotations: kubernetes.io/ingress.class: nginx kubernetes.io/tls-acme: 'true' nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" paths: - / hosts: - dashboard.xiaofu.com tls: - secretName: kubernetes-dashboard-tls hosts: - dashboard.xiaofu.com rbac: clusterAdminRole: true serviceAccount: name: dashboard-adminCopy the code

A few points to note:

Because you must log in using HTTPS, TLS information must be set here. The certificate will be automatically created. RBAC is directly assigned to the role of cluster-admin. In this way, the Dashboard has the maximum permission to view and operate multiple namespaces. If DNS is not available for subsequent queries, modify the hosts file so that dashboard.xiaofu.com points to the IP address of any node

The deployment of

Yaml is used instead of the default values. Yaml. Note the -f parameter

[root@k8s-master helm]# helm install kubernetes-dashboard -f values-xiaofu.yaml --generate-name
NAME: kubernetes-dashboard-1589711621
LAST DEPLOYED: Sun May 17 18:33:41 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
*********************************************************************************
*** PLEASE BE PATIENT: kubernetes-dashboard may take a few minutes to install ***
*********************************************************************************
From outside the cluster, the server URL(s) are:
     https://dashboard.xiaofu.com

Copy the code

Take a look at the Ingress port

[root@k8s-master helm]# kubectl get svc --all-namespaces NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE default Kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 19d default kubernetes-dashboard-1589711621 ClusterIP 10.98.169.133 <none> 443 / TCP 6 m45s ingress - nginx ingress - nginx - controller NodePort 10.96.130.237 < none > 80:31958 / TCP, 443:30265 / TCP 9 d Ingress-nginx ingress-nginx-controller-admission ClusterIP 10.109.76.229 <none> 443/TCP 9d kube-system kube-dns ClusterIP 10.96.0.10 < None > 53/UDP,53/TCP,9153/TCP 19DCopy the code

Use port 30265 corresponding to the HTTPS service here, so local access from dashboard.xiaofu.com: 30265 page setup success

Deploy the POD using Dashboard

Switch to the namespace of Xiaofu-team, as shown below. Save the image and upload it directly (img-djoo2zjs-1589723484687)(3-create.png). After the application succeeds, you will see that the corresponding Service is started [img- xfkgilyV-1589723484690] [4-6666.png] [img- xfkgilyv-1589723484690] [4-6666.png 10.109.117.50:6666 You will see the welcome page for nginx

conclusion

This is a simple Dashboard installation and use, but more detailed custom installation can be found in the values. Yaml fields.