You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: en/access-dashboard.md
+54-28
Original file line number
Diff line number
Diff line change
@@ -10,42 +10,59 @@ TiDB Dashboard is a visualized tool in TiDB 4.0 used to monitor and diagnose the
10
10
11
11
This document describes how to access TiDB Dashboard in Kubernetes.
12
12
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
+
13
29
## Quick start
14
30
15
31
> **Warning:**
16
32
>
17
33
> 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).
18
34
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.
20
36
21
37
1. Deploy the following `.yaml` file into the Kubernetes cluster by running the `kubectl apply -f` command:
22
38
23
39
```yaml
24
40
apiVersion: pingcap.com/v1alpha1
25
41
kind: TidbCluster
26
42
metadata:
27
-
name: basic
43
+
name: basic
28
44
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
33
50
baseImage: pingcap/pd
34
51
replicas: 1
35
52
requests:
36
-
storage: "1Gi"
53
+
storage: "1Gi"
37
54
config: {}
38
-
tikv:
55
+
tikv:
39
56
baseImage: pingcap/tikv
40
57
replicas: 1
41
58
requests:
42
-
storage: "1Gi"
59
+
storage: "1Gi"
43
60
config: {}
44
-
tidb:
61
+
tidb:
45
62
baseImage: pingcap/tidb
46
63
replicas: 1
47
64
service:
48
-
type: ClusterIP
65
+
type: ClusterIP
49
66
config: {}
50
67
```
51
68
@@ -54,17 +71,15 @@ TiDB Dashboard is built in the PD component in 4.0 versions. You can refer to th
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.
61
78
62
79
## Access TiDB Dashboard by Ingress
63
80
64
81
In important production environments, it is recommended to expose the TiDB Dashboard service using Ingress.
65
82
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
-
68
83
### Prerequisites
69
84
70
85
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:
83
98
apiVersion: extensions/v1beta1
84
99
kind: Ingress
85
100
metadata:
86
-
name: access-dashboard
87
-
namespace: ${namespace}
101
+
name: access-dashboard
102
+
namespace: ${namespace}
88
103
spec:
89
-
rules:
104
+
rules:
90
105
- host: ${host}
91
-
http:
106
+
http:
92
107
paths:
93
-
- backend:
94
-
serviceName: ${cluster_name}-pd
95
-
servicePort: 2379
108
+
- backend:
109
+
serviceName: ${cluster_name}-discovery
110
+
servicePort: 10262
96
111
path: /dashboard
97
112
```
98
113
99
114
2. After Ingress is deployed, you can access TiDB Dashboard via <http://${host}/dashboard> outside the Kubernetes cluster.
100
115
101
116
## Enable Ingress TLS
102
117
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
-
107
118
Ingress supports TLS. See [Ingress TLS](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls). The following example shows how to use Ingress TLS:
108
119
109
120
```yaml
@@ -122,8 +133,8 @@ spec:
122
133
http:
123
134
paths:
124
135
- backend:
125
-
serviceName: ${cluster_name}-pd
126
-
servicePort: 2379
136
+
serviceName: ${cluster_name}-discovery
137
+
servicePort: 10262
127
138
path: /dashboard
128
139
```
129
140
@@ -144,3 +155,18 @@ type: kubernetes.io/tls
144
155
```
145
156
146
157
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:
0 commit comments