Skip to content

Commit 0027625

Browse files
ran-huangDanielZhangQDTomShawn
authored
en: update access-dashboard (#452)
* en: update access-dashboard * Update en/access-dashboard.md * Apply suggestions from code review Co-authored-by: TomShawn <[email protected]> Co-authored-by: DanielZhangQD <[email protected]> Co-authored-by: TomShawn <[email protected]>
1 parent b44c1d9 commit 0027625

File tree

1 file changed

+54
-28
lines changed

1 file changed

+54
-28
lines changed

en/access-dashboard.md

+54-28
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,59 @@ TiDB Dashboard is a visualized tool in TiDB 4.0 used to monitor and diagnose the
1010

1111
This document describes how to access TiDB Dashboard in Kubernetes.
1212

13+
## Prerequisites
14+
15+
To access TiDB Dashboard smoothly in Kubernetes, you need to use TiDB Operator v1.1.1 (or later versions) and the TiDB cluster (v4.0.1 or later versions).
16+
17+
You need to configure the `TidbCluster` object file as follows to enable quick access to TiDB Dashboard:
18+
19+
```yaml
20+
apiVersion: pingcap.com/v1alpha1
21+
kind: TidbCluster
22+
metadata:
23+
name: basic
24+
spec:
25+
pd:
26+
enableDashboardInternalProxy: true
27+
```
28+
1329
## Quick start
1430
1531
> **Warning:**
1632
>
1733
> This guide shows how to quickly access TiDB Dashboard. Do **NOT** use this method in the production environment. For production environments, refer to [Access TiDB Dashboard by Ingress](#access-tidb-dashboard-by-ingress).
1834
19-
TiDB Dashboard is built in the PD component in 4.0 versions. You can refer to the following example to quickly deploy a v4.0.0-rc TiDB cluster in Kubernetes.
35+
TiDB Dashboard is built in the PD component in TiDB 4.0 and later versions. You can refer to the following example to quickly deploy a v4.0.1 TiDB cluster in Kubernetes.
2036
2137
1. Deploy the following `.yaml` file into the Kubernetes cluster by running the `kubectl apply -f` command:
2238

2339
```yaml
2440
apiVersion: pingcap.com/v1alpha1
2541
kind: TidbCluster
2642
metadata:
27-
name: basic
43+
name: basic
2844
spec:
29-
version: v4.0.0-rc
30-
timezone: UTC
31-
pvReclaimPolicy: Delete
32-
pd:
45+
version: v4.0.1
46+
timezone: UTC
47+
pvReclaimPolicy: Delete
48+
pd:
49+
enableDashboardInternalProxy: true
3350
baseImage: pingcap/pd
3451
replicas: 1
3552
requests:
36-
storage: "1Gi"
53+
storage: "1Gi"
3754
config: {}
38-
tikv:
55+
tikv:
3956
baseImage: pingcap/tikv
4057
replicas: 1
4158
requests:
42-
storage: "1Gi"
59+
storage: "1Gi"
4360
config: {}
44-
tidb:
61+
tidb:
4562
baseImage: pingcap/tidb
4663
replicas: 1
4764
service:
48-
type: ClusterIP
65+
type: ClusterIP
4966
config: {}
5067
```
5168

@@ -54,17 +71,15 @@ TiDB Dashboard is built in the PD component in 4.0 versions. You can refer to th
5471
{{< copyable "shell-regular" >}}
5572

5673
```shell
57-
kubectl port-forward svc/tidb-pd -n ${namespace} 2379:2379
74+
kubectl port-forward svc/basic-discovery -n ${namespace} 10262:10262
5875
```
5976

60-
3. Visit <http://localhost:2379/dashboard> in your browser to access TiDB Dashboard.
77+
3. Visit <http://localhost:10262/dashboard> in your browser to access TiDB Dashboard.
6178

6279
## Access TiDB Dashboard by Ingress
6380

6481
In important production environments, it is recommended to expose the TiDB Dashboard service using Ingress.
6582

66-
Because the built-in TiDB Dashboard uses the same port as PD APIs do, if you expose TiDB Dashboard in other methods, do not expose the interfaces related to PD APIs.
67-
6883
### Prerequisites
6984

7085
Before using Ingress, install the Ingress controller in your Kubernetes cluster. Otherwise, simply creating Ingress resources does not take effect.
@@ -83,27 +98,23 @@ The following is an `.yaml` example of accessing TiDB Dashboard using Ingress:
8398
apiVersion: extensions/v1beta1
8499
kind: Ingress
85100
metadata:
86-
name: access-dashboard
87-
namespace: ${namespace}
101+
name: access-dashboard
102+
namespace: ${namespace}
88103
spec:
89-
rules:
104+
rules:
90105
- host: ${host}
91-
http:
106+
http:
92107
paths:
93-
- backend:
94-
serviceName: ${cluster_name}-pd
95-
servicePort: 2379
108+
- backend:
109+
serviceName: ${cluster_name}-discovery
110+
servicePort: 10262
96111
path: /dashboard
97112
```
98113

99114
2. After Ingress is deployed, you can access TiDB Dashboard via <http://${host}/dashboard> outside the Kubernetes cluster.
100115

101116
## Enable Ingress TLS
102117

103-
> **Note:**
104-
>
105-
> Ingress presumes that Transport Layer Security (TLS) is terminated. Therefore, if the current TiDB cluster enables [TLS verification](enable-tls-between-components.md), you cannot access TiDB Dashboard by Ingress.
106-
107118
Ingress supports TLS. See [Ingress TLS](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls). The following example shows how to use Ingress TLS:
108119

109120
```yaml
@@ -122,8 +133,8 @@ spec:
122133
http:
123134
paths:
124135
- backend:
125-
serviceName: ${cluster_name}-pd
126-
servicePort: 2379
136+
serviceName: ${cluster_name}-discovery
137+
servicePort: 10262
127138
path: /dashboard
128139
```
129140

@@ -144,3 +155,18 @@ type: kubernetes.io/tls
144155
```
145156

146157
After Ingress is deployed, visit <https://{host}/dashboard> to access TiDB Dashboard.
158+
159+
## Update TiDB cluster
160+
161+
If you enable quick access to TiDB Dashboard by updating an existing TiDB cluster, you need update the following two configurations:
162+
163+
```yaml
164+
apiVersion: pingcap.com/v1alpha1
165+
kind: TidbCluster
166+
metadata:
167+
name: basic
168+
spec:
169+
configUpdateStrategy: RollingUpdate
170+
pd:
171+
enableDashboardInternalProxy: true
172+
```

0 commit comments

Comments
 (0)