Skip to content

Commit

Permalink
en: delete docs about using kubectl apply to update tidb cluster conf…
Browse files Browse the repository at this point in the history
…igurations (#797)

* en: delete docs about using kubectl apply to update tidb cluster configurations

* improve format
  • Loading branch information
Joyinqin committed Oct 28, 2020
1 parent f67ff6a commit c75f31b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 61 deletions.
4 changes: 2 additions & 2 deletions en/deploy-failures.md
Expand Up @@ -69,8 +69,8 @@ If the `StorageClass` of the PVC cannot be found, take the following steps:

3. Update the configuration file:

* If you want to start the TiDB cluster, execute `kubectl apply -f tidb-cluster.yaml` to update the cluster.
* If you want to run a backup/restore task, first execute `kubectl delete -f backup.yaml` to delete the old backup/restore task, and then execute `kubectl apply -f backup.yaml` to create a new backup/restore task.
* If you want to start the TiDB cluster, execute `kubectl edit tc ${cluster_name} -n ${namespace}` to update the cluster.
* If you want to run a backup/restore task, first execute `kubectl delete bk ${backup_name} -n ${namespace}` to delete the old backup/restore task, and then execute `kubectl apply -f backup.yaml` to create a new backup/restore task.

4. Delete Statefulset and the corresponding PVCs:

Expand Down
3 changes: 1 addition & 2 deletions en/deploy-tidb-enterprise-edition.md
Expand Up @@ -48,8 +48,7 @@ spec:

+ If you want to switch an existing Community Edition cluster to Enterprise Edition:

- Method #1: Add the "-enterprise" suffix to the `baseImage` item of the configuration file of the existing cluster in the above format and run the `kubectl apply -f tidb-cluster.yaml -n ${namespace}` command to update the cluster configuration.
- Method #2: Run the `kubectl edit tc ${name} -n ${namespace}` command to add the suffix "-enterprise" to each component's `baseImage` in the above format, and then update the cluster configuration.
Run the `kubectl edit tc ${name} -n ${namespace}` command to add the suffix "-enterprise" to each component's `baseImage` in the above format, and then update the cluster configuration.

TiDB Operator will automatically update the cluster image to the enterprise image through a rolling upgrade.

Expand Down
94 changes: 46 additions & 48 deletions en/restart-a-tidb-cluster.md
Expand Up @@ -14,51 +14,49 @@ If you find that the memory leak occurs in a Pod during use, you need to restart
## Performing a graceful rolling restart to all Pods in a component

1. Refer to [Deploy TiDB on general Kubernetes](deploy-on-general-kubernetes.md) and modify the `${cluster_name}/tidb-cluster.yaml` file.

Add `tidb.pingcap.com/restartedAt` in the annotation of the `spec` of the TiDB component you want to gracefully rolling restart, and set its value to be the current time.

In the following example, annotations of the `pd`, `tikv`, and `tidb` components are set, which means that all the Pods in these three components will be gracefully rolling restarted. You can set the annotation for a specific component according to your needs.

```yaml
apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: basic
spec:
version: v4.0.7
timezone: UTC
pvReclaimPolicy: Delete
pd:
baseImage: pingcap/pd
replicas: 3
requests:
storage: "1Gi"
config: {}
annotations:
tidb.pingcap.com/restartedAt: 2020-04-20T12:00
tikv:
baseImage: pingcap/tikv
replicas: 3
requests:
storage: "1Gi"
config: {}
annotations:
tidb.pingcap.com/restartedAt: 2020-04-20T12:00
tidb:
baseImage: pingcap/tidb
replicas: 2
service:
type: ClusterIP
config: {}
annotations:
tidb.pingcap.com/restartedAt: 2020-04-20T12:00
```

2. Apply the update:

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

``` shell
kubectl apply -f ${cluster_name} -n ${namespace}
```
Refer to [Deploy TiDB on general Kubernetes](deploy-on-general-kubernetes.md) and modify the `${cluster_name}/tidb-cluster.yaml` file by running the following command:

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

```shell
kubectl edit tc ${name} -n ${namespace}
```

Add `tidb.pingcap.com/restartedAt` in the annotation of the `spec` of the TiDB component you want to gracefully rolling restart, and set its value to be the current time.

In the following example, annotations of the `pd`, `tikv`, and `tidb` components are set, which means that all the Pods in these three components will be gracefully rolling restarted. You can set the annotation for a specific component according to your needs.

```yaml
apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: basic
spec:
version: v4.0.7
timezone: UTC
pvReclaimPolicy: Delete
pd:
baseImage: pingcap/pd
replicas: 3
requests:
storage: "1Gi"
config: {}
annotations:
tidb.pingcap.com/restartedAt: 2020-04-20T12:00
tikv:
baseImage: pingcap/tikv
replicas: 3
requests:
storage: "1Gi"
config: {}
annotations:
tidb.pingcap.com/restartedAt: 2020-04-20T12:00
tidb:
baseImage: pingcap/tidb
replicas: 2
service:
type: ClusterIP
config: {}
annotations:
tidb.pingcap.com/restartedAt: 2020-04-20T12:00
```
10 changes: 1 addition & 9 deletions en/scale-a-tidb-cluster.md
Expand Up @@ -18,14 +18,6 @@ Currently, the TiDB cluster supports management by TidbCluster Custom Resource (

Modify `spec.pd.replicas`, `spec.tidb.replicas`, and `spec.tikv.replicas` in the `TidbCluster` object of the cluster to a desired value using kubectl. You can modify the values in the local file or using online command.

- If a yaml file that describes the TiDB cluster exists in your local machine, modify `spec.pd.replicas`, `spec.tidb.replicas`, and `spec.tikv.replicas` in the local file to your desired values. Then deploy the yaml file to the cluster by running the following command:

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

```shell
kubectl apply -f ${target_file}.yaml -n ${namespace}
```

- You can also online modify the `TidbCluster` definition in the Kubernetes cluster by running the following command:

{{< copyable "shell-regular" >}}
Expand All @@ -34,7 +26,7 @@ Modify `spec.pd.replicas`, `spec.tidb.replicas`, and `spec.tikv.replicas` in the
kubectl edit tidbcluster ${cluster_name} -n ${namespace}
```

After modifying the values above, check whether the TiDB cluster in Kubernetes has updated to your desired definition:
Check whether the TiDB cluster in Kubernetes has updated to your desired definition by running the following command:

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

Expand Down

0 comments on commit c75f31b

Please sign in to comment.