Get the App
SLTechnology News&Howtos  ›  Servers  › 

K8S multi-master deployment 3: deploy the DashBoard-UI interface

Shulou Source: shulou.com Published: 2022-06-02 06:10:39 09月30日 Update

Previously on...

All of the following are done when a single master cluster has completed its deployment.

All servers ensure that the firewall is always closed and the core function selinux is turned off.

Server role assignment role address installation component master192.168.142.220kube-apiserver kube-controller-manager kube-scheduler etcdmaster02192.168.142.120kube-apiserver kube-controller-manager kube-schedulernode1192.168.142.136kubelet kube-proxy docker flannel etcdnode2192.168.142.132kubelet kube-proxy docker flannel etcdnginx1192.168.142.130nginx keepalivednginx2192.168.142.140nginx keepalivedVIP192.168.142.20 virtual address Masterside to establish DashBoard

Establish a dashboard working directory

# operate on master [root@master ~] # cd / k8s/# will upload the page file to this folder [root@master k8s] # mkdir dashboard

"dashboard-rbac" license to connect to APIserver

"dashboard-secret" for encryption configuration

"dashboard-configmap" dashboard profile

"dashboard-controller" application configuration

"dashboard-service" is used to publish applications

The above four YAML files are downloaded from GITHUB at https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dashboard

The order of generating related POD# cannot be changed! Remember! Remember! [root@master dashboard] # kubectl create-f dashboard-rbac.yaml [root@master dashboard] # kubectl create-f dashboard-secret.yaml [root@master dashboard] # kubectl create-f dashboard-configmap.yaml [root@master dashboard] # kubectl create-f dashboard-controller.yaml [root@master dashboard] # kubectl create-f dashboard-service.yaml put POD into the specified namespace [root@master dashboard] # kubectl get pods-n kube-systemNAME READY STATUS RESTARTS AGEkubernetes-dashboard-65f974f565-d2wgw 1 move 1 Running 2 90s# View details [root@master dashboard] # kubectl get pods Svc-n kube-systemNAME READY STATUS RESTARTS AGEpod/kubernetes-dashboard-65f974f565-d2wgw 1 Running 1 116sNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEservice/kubernetes-dashboard NodePort 10.0.0.109 443:30001/TCP 112s at this time You can access port 30001 of a node node in the browser

The root cause of this problem is the lack of certificates, and some browsers block insecure access

Write an execution script to self-sign the certificate

[root@master01 dashboard] # bash dashboard.sh / root/k8s/apiserver/## script is written manually #! / bin/bash#DashBoard Certificate # cat > dashboard-csr.json

Tags: Applications tokens files certificates configurations addresses generation that is servers browsers scripts nodes roles pages services browsing security information functions reasons Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info macOS OPPO Reno Xiaomi vpn