"Kubernetes"-Graphical Management Interface (Dashboard) @20210227

Through the Web UI (Dashboard) interface, you can manage cluster resources, display running applications, view resource status, and view cluster information. This article will introduce how to install and deploy the Kubernetes Dashboard graphical interface.

project address:

System environment

Attributes parameter
System environment: CentOS Linux release 7.5.1804 (Core)
Software version: Kubernetes v1.14.0
  Docker version 19.03.2, build 6a30dfc
  Helm v3.0.0-beta.3
Internet Information: k8s-master x 1 / 172.31.253.28
  k8s-node01 x 1 / 172.31.253.29

The first step, download the deployment file

Kubernetes v1.14.0 and Dashboard v2.0.0-beta1

According to the Release description, Kubernetes 1.14 should use Dashboard v2.0.0-beta1 version:

wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta1/aio/deploy/recommended.yaml

Kubernetes v1.16.2 and Dashboard v2.0.0-rc3

According to the Release description, v2.0.0 -rc3 is compatible with Kubernetes 1.16; and v2.0.0 -rc4 due to major changes between Kubernetes API versions, some functions cannot be used normally. Therefore we deploy the v2.0.0-rc3 version:

wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc3/aio/deploy/recommended.yaml

The second step, adjust the deployment file

Modify the deployment file according to your needs:

Use private mirror address

For example, to modify the mirror address, use the mirror in the private mirror warehouse:
1) Pull the target mirror, create a label, and push the warehouse if there is;
2) Modify the YAML file;

Modify the namespace location

2) Use the namespace planned by yourself;

The third step, application deployment files

The official configuration uses the kubernetes-dashboard command space (because it is a beta version, it is placed in a separate namespace for later cleanup).

#!/bin/sh 

# Delete the old namespace (optional) 
kubectl delete ns kubernetes-dashboard 

# Application deployment file 
kubectl apply -f recommended.yaml

# Log in to the dashboard

-" SKIP button in kubernetes dashboard is missing #703 "
In the new version of Kubernetes Dashboard, for security reasons, SKIP button is no longer provided, so when operating through the Dashboard cluster, you need to create a password first.

-" How to sign in kubernetes dashboard? " Please
refer to this article on how to generate a password.

# Exposure Service (Ingress)

In order to allow external access, we expose the service through Ingress, but with "special configuration". The situation is like this. The front-end Nginx Ingress will decode the HTTPS connection, and then pass the HTTP request to the back-end Dashboard, and the Dashboard only handles the HTTPS connection, which makes the connection impossible. There are two solutions: make Dashboard listen on port 80; connect HTTPS directly to the Dashboard container.

Method 1: Make Dashboard listen to port 80

We do not want to introduce it, it is not safe, and it is not an official recommended practice. The following are the container startup parameters:

--auto-generate-certificates=false
--insecure-bind-address=0.0.0.0
--port=80
--insecure-port=9090
--enable-insecure-login

Use the above parameters to enable the HTTP protocol (this was passed to me by others).

Method 2: Connect HTTPS directly to the Dashboard container

This is the method we currently use and requires the following operations:

	1) Since Nginx Ingress Controller disables SSL passthrough by default, it is necessary to modify its resource definition (Daemonset or Deployment) and add the ``--enable-ssl-passthrough'' option to the container startup parameters to enable SSL passthrough. But this is only to enable the SSL pass-through function, and SSL pass-through needs to be configured separately.
	2) In the Ingress definition of Dashboard, add the annotation "nginx.ingress.kubernetes.io/ssl-passthrough: true" for passthrough.
	3) If you want to configure a TLS certificate, refer to the note "[[05.Kubernetes Cluster:z.Error List (Kubernetes):DASHBOARD-Chrome NET ERR CERT INVALID|DASHBOARD-Chrome NET ERR CERT INVALID]]", the process is similar (Modify the kubernetes-dashboard-certs key).

Finally, you can bind HOST to perform an access test (the detailed process is skipped).

Related Links

Kubernetes/TAKS/Web UI (Dashboard)
GitHub/kubernetes/dashboard/docs/user/access-control/creating-sample-user.md

related articles

"Kubernetes"-Deploy the NGINX Ingress Controller component
"Kubernetes"-Install the cert-manager component
"K8s"-Traefik Installation
" NGINX Ingress Controller" -Modify the default redirect status code "Rook-Ceph" -Build a
cluster environment

references

GitHub/helm/charts/stable/kubernetes-dashboard
GitHub/kubernetes/dashboard/v2.0.0-beta4
NGINX Ingress Controller/Command line arguments
NGINX Ingress Controller/Annotations/SSL Passthrough

Guess you like

Origin blog.csdn.net/u013670453/article/details/114190019