Skip to content

Commit dc35e17

Browse files
csuzhangxcti-chi-bot
authored andcommitted
This is an automated cherry-pick of #3050
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
1 parent a41683d commit dc35e17

17 files changed

+340
-19
lines changed

en/cheat-sheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ See [kubectl Cheat Sheet](https://kubernetes.io/docs/reference/kubectl/cheatshee
434434
{{< copyable "shell-regular" >}}
435435

436436
```shell
437-
helm repo add pingcap https://charts.pingcap.org/
437+
helm repo add pingcap https://charts.pingcap.com/
438438
```
439439

440440
### Update Helm repository

en/clinic-user-guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Before deploying Diag, make sure the following items are installed on the cluste
3838

3939
#### Install Helm
4040

41-
To install Helm and configure the chart repository `https://charts.pingcap.org/` maintained by PingCAP, you can refer to the [Use Helm](tidb-toolkit.md#use-helm) document.
41+
To install Helm and configure the chart repository `https://charts.pingcap.com/` maintained by PingCAP, you can refer to the [Use Helm](tidb-toolkit.md#use-helm) document.
4242

4343
> **Note:**
4444
>
@@ -261,7 +261,7 @@ If your cluster cannot access the Internet, you can deploy Diag using the offlin
261261
To download Diag chart files, you can use the following command:
262262
263263
```shell
264-
wget http://charts.pingcap.org/diag-${chart_version}.tgz
264+
wget http://charts.pingcap.com/diag-${chart_version}.tgz
265265
```
266266
267267
Copy `diag-${chart_version}.tgz` to the cluster and unpack it to the current directory.
@@ -699,4 +699,4 @@ The following introduces how to use PingCAP Clinic to perform a quick check on a
699699
- The first part is the basic information about the cluster.
700700
- The second part is the sampling information.
701701
- The third part is the diagnostic results, including potential configuration problems. For each configuration potential risk found, Diag provides a corresponding knowledge base link with detailed configuration suggestions.
702-
- The last line is the file path of the result report and record.
702+
- The last line is the file path of the result report and record.

en/deploy-br-federation.md

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
---
2+
title: Deploy BR Federation on Kubernetes
3+
summary: Learn how to deploy BR Federation on Kubernetes.
4+
---
5+
6+
# Deploy BR Federation on Kubernetes
7+
8+
This document describes how to deploy [BR Federation](br-federation-architecture.md#br-federation-architecture-and-processes) across multiple Kubernetes clusters.
9+
10+
## Prerequisites
11+
12+
Before deploy BR Federation on Kubernetes cluster, make sure you have met the following prerequisites:
13+
14+
* Kubernetes version must be >= v1.24.
15+
* You must have multiple Kubernetes clusters.
16+
* You have deployed TiDB Operator for all the Kubernetes clusters that serve as data planes.
17+
18+
## Step 1: Generate a kubeconfig file in data planes
19+
20+
The BR Federation manages Kubernetes clusters of data planes by accessing their API servers. To authenticate and authorize itself in the API servers, BR Federation requires a kubeconfig file. The users or service accounts in the kubeconfig file need to have at least all the permissions of **backups.pingcap.com** and **restores.pingcap.com** CRD.
21+
22+
You can get the kubeconfig file from the Kubernetes cluster administrator. However, if you have permission to access all the data planes, you can generate the kubeconfig file on your own.
23+
24+
### Step 1.1: Create RBAC resources in data planes
25+
26+
To enable the BR Federation to manipulate Backup and Restore CR, you need to create the following resources in every data plane.
27+
28+
```yaml
29+
apiVersion: v1
30+
kind: ServiceAccount
31+
metadata:
32+
name: br-federation-member
33+
namespace: tidb-admin
34+
---
35+
apiVersion: rbac.authorization.k8s.io/v1
36+
kind: ClusterRole
37+
metadata:
38+
name: br-federation-manager:br-federation-member
39+
rules:
40+
- apiGroups:
41+
- pingcap.com
42+
resources:
43+
- backups
44+
- restores
45+
verbs:
46+
- '*'
47+
---
48+
apiVersion: rbac.authorization.k8s.io/v1
49+
kind: ClusterRoleBinding
50+
metadata:
51+
name: br-federation-manager:br-federation-member
52+
roleRef:
53+
apiGroup: rbac.authorization.k8s.io
54+
kind: ClusterRole
55+
name: br-federation-manager:br-federation-member
56+
subjects:
57+
- kind: ServiceAccount
58+
name: br-federation-member
59+
namespace: tidb-admin
60+
```
61+
62+
For Kubernetes >= v1.24, to let external applications access the Kubernetes API server, you need to manually create a service account secret as follows:
63+
64+
```yaml
65+
apiVersion: v1
66+
kind: Secret
67+
type: kubernetes.io/service-account-token
68+
metadata:
69+
name: br-federation-member-secret
70+
namespace: tidb-admin
71+
annotations:
72+
kubernetes.io/service-account.name: "br-federation-member"
73+
```
74+
75+
### Step 1.2: Generate kubeconfig files
76+
77+
Execute the following script for every data plane.
78+
79+
```shell
80+
# for Kubernetes < 1.24
81+
export TOKEN_SECRET_NAME=$(kubectl -n tidb-admin get serviceaccount br-federation-member -o=jsonpath='{.secrets[0].name}')
82+
# for Kubernetes >= 1.24, the service account secret should be created manually as above, so you should use its name as value of TOKEN_SECRET_NAME
83+
# export TOKEN_SECRET_NAME=br-federation-member-secret
84+
export USER_TOKEN_VALUE=$(kubectl -n tidb-admin get secret/${TOKEN_SECRET_NAME} -o=go-template='{{.data.token}}' | base64 --decode)
85+
export CURRENT_CONTEXT=$(kubectl config current-context)
86+
export CURRENT_CLUSTER=$(kubectl config view --raw -o=go-template='{{range .contexts}}{{if eq .name "'''${CURRENT_CONTEXT}'''"}}{{ index .context "cluster" }}{{end}}{{end}}')
87+
export CLUSTER_CA=$(kubectl config view --raw -o=go-template='{{range .clusters}}{{if eq .name "'''${CURRENT_CLUSTER}'''"}}"{{with index .cluster "certificate-authority-data" }}{{.}}{{end}}"{{ end }}{{ end }}')
88+
export CLUSTER_SERVER=$(kubectl config view --raw -o=go-template='{{range .clusters}}{{if eq .name "'''${CURRENT_CLUSTER}'''"}}{{ .cluster.server }}{{end}}{{ end }}')
89+
# you should modify this value in different data plane
90+
export DATA_PLANE_SYMBOL="a"
91+
92+
cat << EOF > {k8s-name}-kubeconfig
93+
apiVersion: v1
94+
kind: Config
95+
current-context: ${DATA_PLANE_SYMBOL}
96+
contexts:
97+
- name: ${DATA_PLANE_SYMBOL}
98+
context:
99+
cluster: ${CURRENT_CLUSTER}
100+
user: br-federation-member-${DATA_PLANE_SYMBOL}
101+
namespace: kube-system
102+
clusters:
103+
- name: ${CURRENT_CLUSTER}
104+
cluster:
105+
certificate-authority-data: ${CLUSTER_CA}
106+
server: ${CLUSTER_SERVER}
107+
users:
108+
- name: br-federation-member-${DATA_PLANE_SYMBOL}
109+
user:
110+
token: ${USER_TOKEN_VALUE}
111+
EOF
112+
```
113+
114+
The environment variable `$DATA_PLANE_SYMBOL` represents the name of the data plane cluster. Make sure that you provide a brief and unique name. In the preceding script, you use this variable as the context name for kubeconfig. The context name will be used as `k8sClusterName` in both the `VolumeBackup` and `VolumeRestore` CR.
115+
116+
### Step 1.3: Merge multiple kubeconfig files into one
117+
118+
After following the previous steps to generate kubeconfig, you now have multiple kubeconfig files. You need to merge them into a single kubeconfig file.
119+
120+
Assume that you have 3 kubeconfig files with file paths: `kubeconfig-path1`, `kubeconfig-path2`, `kubeconfig-path3`. To merge these files into one kubeconfig file with file path `data-planes-kubeconfig`, execute the following command:
121+
122+
```shell
123+
KUBECONFIG=${kubeconfig-path1}:${kubeconfig-path2}:${kubeconfig-path3} kubectl config view --flatten > ${data-planes-kubeconfig}
124+
```
125+
126+
## Step 2: Deploy BR Federation in the control plane
127+
128+
To deploy the BR Federation, you need to select one Kubernetes cluster as the control plane. The following steps **must be executed on the control plane**.
129+
130+
### Step 2.1: Create CRD
131+
132+
The BR Federation uses [Custom Resource Definition (CRD)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions) to extend Kubernetes. Before using the BR Federation, you must create the CRD in your Kubernetes cluster. After using the BR Federation Manager, you only need to perform the operation once.
133+
134+
```shell
135+
kubectl create -f https://raw.githubusercontent.com/pingcap/tidb-operator/{{{ .tidb_operator_version }}}/manifests/federation-crd.yaml
136+
```
137+
138+
### Step 2.2: Prepare the kubeconfig secret
139+
140+
Now that you already have a kubeconfig file of data planes, you need to encode the kubeconfig file into a secret. Take the following steps:
141+
142+
1. Encode the kubeconfig file:
143+
144+
```shell
145+
base64 -i ${kubeconfig-path}
146+
```
147+
148+
2. Store the output from the previous step in a secret object.
149+
150+
Note that the name of the secret and the data key of the kubeconfig field **must** match the following example:
151+
152+
```yaml
153+
apiVersion: v1
154+
kind: Secret
155+
metadata:
156+
name: br-federation-kubeconfig
157+
type: Opaque
158+
data:
159+
kubeconfig: ${encoded-kubeconfig}
160+
```
161+
162+
### Step 2.3: Install BR Federation
163+
164+
This section describes how to install the BR Federation using [Helm 3](https://helm.sh/docs/intro/install/).
165+
166+
- If you prefer to use the default configuration, follow the **Quick deployment** steps.
167+
- If you prefer to use a custom configuration, follow the **Custom deployment** steps.
168+
169+
<SimpleTab>
170+
<div label="Quick deployment">
171+
172+
1. To create resources related to the BR Federation, create a namespace:
173+
174+
```shell
175+
kubectl create ns br-fed-admin
176+
```
177+
178+
2. In the specified namespace, create a secret that contains all the encoded kubeconfig files:
179+
180+
```shell
181+
kubectl create -f ${secret-path} -n br-fed-admin
182+
```
183+
184+
3. Add the PingCAP repository:
185+
186+
```shell
187+
helm repo add pingcap https://charts.pingcap.com/
188+
```
189+
190+
4. Install the BR Federation:
191+
192+
```shell
193+
helm install --namespace br-fed-admin br-federation pingcap/br-federation --version {{{ .tidb_operator_version }}}
194+
```
195+
196+
</div>
197+
<div label="Custom deployment">
198+
199+
1. To create resources related to the BR Federation, create a namespace:
200+
201+
```shell
202+
kubectl create ns br-fed-admin
203+
```
204+
205+
2. In the specified namespace, create a secret that contains all the encoded kubeconfig files:
206+
207+
```shell
208+
kubectl create -f ${secret-path} -n br-fed-admin
209+
```
210+
211+
3. Add the PingCAP repository:
212+
213+
```shell
214+
helm repo add pingcap https://charts.pingcap.com/
215+
```
216+
217+
4. Get the `values.yaml` file of the desired `br-federation` chart for deployment.
218+
219+
```shell
220+
mkdir -p ${HOME}/br-federation && \
221+
helm inspect values pingcap/br-federation --version={{{ .tidb_operator_version }}} > ${HOME}/br-federation/values.yaml
222+
```
223+
224+
5. Configure the BR Federation by modifying fields such as `image`, `limits`, `requests`, and `replicas` according to your needs.
225+
226+
6. Deploy the BR Federation.
227+
228+
```shell
229+
helm install --namespace br-fed-admin br-federation pingcap/br-federation --version {{{ .tidb_operator_version }}} -f ${HOME}/br-federation/values.yaml && \
230+
kubectl get po -n br-fed-admin -l app.kubernetes.io/instance=br-federation
231+
```
232+
233+
</div>
234+
</SimpleTab>
235+
236+
## What's next
237+
238+
After deploying BR Federation, you can now perform the following tasks:
239+
240+
- [Back Up a TiDB Cluster across Multiple Kubernetes Using EBS Volume Snapshots](backup-by-ebs-snapshot-across-multiple-kubernetes.md)
241+
- [Restore a TiDB Cluster across Multiple Kubernetes from EBS Volume Snapshots](restore-from-ebs-snapshot-across-multiple-kubernetes.md)

en/deploy-tidb-from-kubernetes-gke.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ If you see `Ready` for all nodes, congratulations. You've set up your first Kube
8888
2. Add the PingCAP repository:
8989

9090
```shell
91-
helm repo add pingcap https://charts.pingcap.org/
91+
helm repo add pingcap https://charts.pingcap.com/
9292
```
9393

9494
## Deploy TiDB Operator

en/deploy-tidb-operator.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ If your server cannot access the Internet, install TiDB Operator offline by the
149149
{{< copyable "shell-regular" >}}
150150
151151
```shell
152+
<<<<<<< HEAD
152153
wget http://charts.pingcap.org/tidb-operator-v1.3.10.tgz
154+
=======
155+
wget http://charts.pingcap.com/tidb-operator-{{{ .tidb_operator_version }}}.tgz
156+
>>>>>>> c31147b3 (zh, en: switch Helm chart domain (#3050))
153157
```
154158
155159
Copy the `tidb-operator-v1.3.10.tgz` file to the target server and extract it to the current directory:

en/get-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ This section describes how to install TiDB Operator using [Helm 3](https://helm.
218218
{{< copyable "shell-regular" >}}
219219

220220
```shell
221-
helm repo add pingcap https://charts.pingcap.org/
221+
helm repo add pingcap https://charts.pingcap.com/
222222
```
223223

224224
<details>

en/migrate-to-helm3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ tidb-operator 1 Tue Jan 5 15:28:00 2021 DEPLOYED
7373

7474
```
7575
NAME URL
76-
pingcap https://charts.pingcap.org/
76+
pingcap https://charts.pingcap.com/
7777
```
7878

7979
4. Migrate the releases from Helm 2 to Helm 3:

en/tidb-toolkit.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ Kubernetes applications are packed as charts in Helm. PingCAP provides the follo
182182
* `tidb-drainer`: used to deploy TiDB Drainer;
183183
* `tikv-importer`: used to deploy TiKV Importer.
184184

185-
These charts are hosted in the Helm chart repository `https://charts.pingcap.org/` maintained by PingCAP. You can add this repository to your local server or computer using the following command:
185+
These charts are hosted in the Helm chart repository `https://charts.pingcap.com/` maintained by PingCAP. You can add this repository to your local server or computer using the following command:
186186

187187
{{< copyable "shell-regular" >}}
188188

189189
```shell
190-
helm repo add pingcap https://charts.pingcap.org/
190+
helm repo add pingcap https://charts.pingcap.com/
191191
```
192192

193193
Then you can search the chart provided by PingCAP using the following command:
@@ -267,9 +267,14 @@ Use the following command to download the chart file required for cluster instal
267267
{{< copyable "shell-regular" >}}
268268

269269
```shell
270+
<<<<<<< HEAD
270271
wget http://charts.pingcap.org/tidb-operator-v1.3.10.tgz
271272
wget http://charts.pingcap.org/tidb-drainer-v1.3.10.tgz
272273
wget http://charts.pingcap.org/tidb-lightning-v1.3.10.tgz
274+
=======
275+
wget http://charts.pingcap.com/tidb-operator-{{{ .tidb_operator_version }}}.tgz
276+
wget http://charts.pingcap.com/tidb-lightning-{{{ .tidb_operator_version }}}.tgz
277+
>>>>>>> c31147b3 (zh, en: switch Helm chart domain (#3050))
273278
```
274279
275280
Copy these chart files to the server and decompress them. You can use these charts to install the corresponding components by running the `helm install` command. Take `tidb-operator` as an example:

en/upgrade-tidb-operator.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,38 @@ summary: Learn how to perform online upgrade and offline upgrade to TiDB Operato
77

88
This document describes how to upgrade TiDB Operator to a specific version. You can choose either [online upgrade](#online-upgrade) or [offline upgrade](#offline-upgrade).
99

10+
## Upgrade considerations
11+
12+
Review the following items before you upgrade TiDB Operator.
13+
14+
- Effective January 4, 2026, the TiDB Operator Helm chart repository domain changes from `charts.pingcap.org` to `charts.pingcap.com`. If you previously installed TiDB Operator from `charts.pingcap.org`, follow these steps to update your Helm repository configuration:
15+
16+
1. Remove the old Helm repository:
17+
18+
```shell
19+
helm repo remove pingcap
20+
```
21+
22+
2. Add the new Helm repository:
23+
24+
```shell
25+
helm repo add pingcap https://charts.pingcap.com/
26+
```
27+
28+
3. Update the Helm repository index:
29+
30+
```shell
31+
helm repo update pingcap
32+
```
33+
34+
- If you use TiDB Operator v1.3.0-beta.1 or earlier to deploy a TiDB cluster across multiple Kubernetes clusters, upgrading TiDB Operator directly causes a rolling update and can result in an abnormal cluster state. To upgrade TiDB Operator from an earlier version to v1.3, perform the following steps:
35+
36+
1. Update the Custom Resource Definitions (CRDs).
37+
2. In the `TidbCluster` specification, set `spec.acrossK8s` to `true`.
38+
3. Upgrade TiDB Operator.
39+
40+
- The Pod `ValidatingWebhook` and `MutatingWebhook` are deprecated. If you use TiDB Operator v1.2 or earlier with these webhooks enabled, upgrading to v1.3.0-beta.1 or later removes them. This removal does not affect TiDB cluster management or any running TiDB clusters.
41+
1042
## Online upgrade
1143

1244
If your server has access to the internet, you can perform online upgrade by taking the following steps:
@@ -130,7 +162,11 @@ If your server cannot access the Internet, you can offline upgrade by taking the
130162
{{< copyable "shell-regular" >}}
131163

132164
```bash
165+
<<<<<<< HEAD
133166
wget http://charts.pingcap.org/tidb-operator-v1.3.10.tgz
167+
=======
168+
wget http://charts.pingcap.com/tidb-operator-{{{ .tidb_operator_version }}}.tgz
169+
>>>>>>> c31147b3 (zh, en: switch Helm chart domain (#3050))
134170
```
135171
136172
3. Download the Docker images required for the new TiDB Operator version:

0 commit comments

Comments
 (0)