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/configure-a-tidb-cluster.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ It is recommended that you configure `spec.pvReclaimPolicy: Retain` to ensure th
68
68
69
69
#### mountClusterClientSecret
70
70
71
-
PD and TiKV supports configuring `mountClusterClientSecret`. If [TLS is enabled between cluster components](enable-tls-between-components.md), it is recommended to configure `spec.pd.mountClusterClientSecret: true` and `spec.tikv.mountClusterClientSecret: true`. Under such configuration, TiDB Operator automatically mounts the `${cluster_name}-cluster-client-secret` certificate to the PD and TiKV container, so you can conveniently [use `pd-ctl` and `tikv-ctl`](enable-tls-between-components.md#configure-pd-ctl-tikv-ctl-and-connect-to-the-cluster).
71
+
PD and TiKV supports configuring `mountClusterClientSecret`. If [TLS is enabled between cluster components](enable-tls-between-components.md), it is recommended to configure `spec.pd.mountClusterClientSecret: true` and `spec.tikv.mountClusterClientSecret: true`. Under such configuration, TiDB Operator automatically mounts the `${cluster_name}-cluster-client-secret` certificate to the PD and TiKV container, so you can conveniently [use `pd-ctl` and `tikv-ctl`](enable-tls-between-components.md#step-3-configure-pd-ctl-tikv-ctl-and-connect-to-the-cluster).
Copy file name to clipboardExpand all lines: en/enable-tls-between-components.md
+91-4Lines changed: 91 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,8 @@ To enable TLS between TiDB components, perform the following steps:
22
22
23
23
> **Note:**
24
24
>
25
-
> After the cluster is created, do not modify this field; otherwise, the cluster will fail to upgrade. If you need to modify this field, delete the cluster and create a new one.
25
+
> - After the cluster is created, do not modify this field; otherwise, the cluster will fail to upgrade. If you need to modify this field, delete the cluster and create a new one.
26
+
> - If you cannot rebuild the cluster but need to enable TLS, see [Upgrade a non-TLS cluster to a TLS cluster](#upgrade-a-non-tls-cluster-to-a-tls-cluster).
26
27
27
28
3. Configure `pd-ctl` and `tikv-ctl` to connect to the cluster.
28
29
@@ -38,7 +39,7 @@ Certificates can be issued in multiple methods. This document describes two meth
38
39
39
40
If you need to renew the existing TLS certificate, refer to [Renew and Replace the TLS Certificate](renew-tls-certificate.md).
40
41
41
-
## Generate certificates for components of the TiDB cluster
42
+
## Step 1. Generate certificates for components of the TiDB cluster
42
43
43
44
This section describes how to issue certificates using two methods: `cfssl` and `cert-manager`.
44
45
@@ -1306,7 +1307,7 @@ This section describes how to issue certificates using two methods: `cfssl` and
1306
1307
1307
1308
After the object is created, `cert-manager` generates a `${cluster_name}-cluster-client-secret` Secret object to be used by the clients of the TiDB components.
1308
1309
1309
-
## Deploy the TiDB cluster
1310
+
## Step 2. Deploy the TiDB cluster
1310
1311
1311
1312
When you deploy a TiDB cluster, you can enable TLS between TiDB components, and set the `cert-allowed-cn` configuration item (for TiDB, the configuration item is `cluster-verify-cn`) to verify the CN (Common Name) of each component's certificate.
1312
1313
@@ -1516,7 +1517,7 @@ In this step, you need to perform the following operations:
1516
1517
kubectl apply -f restore.yaml
1517
1518
```
1518
1519
1519
-
## Configure `pd-ctl`, `tikv-ctl` and connect to the cluster
1520
+
## Step 3. Configure `pd-ctl`, `tikv-ctl` and connect to the cluster
1520
1521
1521
1522
1. Mount the certificates.
1522
1523
@@ -1570,3 +1571,89 @@ In this step, you need to perform the following operations:
This section describes how to enable TLS encrypted communication for an existing non-TLS TiDB cluster.
1578
+
1579
+
>**Note:**
1580
+
>
1581
+
> This operation is only applicable to existing clusters that cannot be rebuilt. Before starting, make sure that you fully understand each step and its potential risks.
1582
+
1583
+
1. If the cluster contains multiple PD nodes, first reduce the number of PD nodes to 1.
1584
+
1585
+
2. Refer to [Step 1. Generate certificates for components of the TiDB Cluster](#step-1-generate-certificates-for-components-of-the-tidb-cluster) to generate TLS certificates and create Kubernetes Secret objects.
1586
+
1587
+
3. Enable TLS:
1588
+
1589
+
You can choose one of the following methods to enable TLS:
1590
+
1591
+
- Method 1: Execute the following command to update the TiDB cluster configuration. Wait for the PD Pod to restart before proceeding to the next step.
- Method 2: Refer to [Step 2. Deploy the TiDB cluster](#step-2-deploy-the-tidb-cluster) to enable TLS and set the `cert-allowed-cn` configuration item (for TiDB, the configuration item is `cluster-verify-cn`) to verify the CN (Common Name) of each component's certificate.
1610
+
1611
+
4. Configure PD nodes:
1612
+
1613
+
1. Use `kubectl exec` to enter the PD Pod and install `etcdctl`. For detailed installation steps, see the [etcdctl installation guide](https://etcd.io/docs/v3.4/install/). After installation, `etcdctl` is located in the extracted folder directory.
1614
+
1615
+
2. View the etcd member information. At this point, `peerURLs` use the HTTP protocol:
1616
+
1617
+
```shell
1618
+
./etcdctl --endpoints https://127.0.0.1:2379 --cert /var/lib/pd-tls/tls.crt --key /var/lib/pd-tls/tls.key --cacert /var/lib/pd-tls/ca.crt member list
1619
+
```
1620
+
1621
+
Example output:
1622
+
1623
+
```shell
1624
+
# memberID status name peerURLs clientURL isLearner
Copy file name to clipboardExpand all lines: en/restore-data-using-tidb-lightning.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ For versions earlier than v1.1.10, you can modify `config` in `values.yaml` to s
52
52
53
53
#### Configure TLS
54
54
55
-
If TLS between components has been enabled on the target TiDB cluster (`spec.tlsCluster.enabled: true`), refer to [Generate certificates for components of the TiDB cluster](enable-tls-between-components.md#generate-certificates-for-components-of-the-tidb-cluster) to genereate a server-side certificate for TiDB Lightning, and configure `tlsCluster.enabled: true` in `values.yaml` to enable TLS between components.
55
+
If TLS between components has been enabled on the target TiDB cluster (`spec.tlsCluster.enabled: true`), refer to [Generate certificates for components of the TiDB cluster](enable-tls-between-components.md#step-1-generate-certificates-for-components-of-the-tidb-cluster) to generate a server-side certificate for TiDB Lightning, and configure `tlsCluster.enabled: true` in `values.yaml` to enable TLS between components.
56
56
57
57
If the target TiDB cluster has enabled TLS for the MySQL client (`spec.tidb.tlsClient.enabled: true`), and the corresponding client-side certificate is configured (the Kubernetes Secret object is `${cluster_name}-tidb-client-secret`), you can configure `tlsClient.enabled: true` in `values.yaml` to enable TiDB Lightning to connect to the TiDB server using TLS.
0 commit comments