Skip to content

Commit

Permalink
Merge pull request #65 from hayleyling/document
Browse files Browse the repository at this point in the history
Doc: add v2.2.0 release notes and update the doc list structure #64
  • Loading branch information
KID-G authored Jul 7, 2022
2 parents 1fa4b0e + fe9f098 commit a929fa4
Show file tree
Hide file tree
Showing 98 changed files with 2,881 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "v2.1.3"
title: "v2.1.4"
# weight从小到大排列,默认选择第一个
weight: 1
pdf: "/pdf/v2.1_zh.pdf"
weight: 2
pdf: "/pdf/v2.1_en.pdf"
---
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "1.0"
weight: 8
weight: 20
---

RadonDB MySQL kubernetes 1.0.0/1.1.0/1.2.0 were deployed by Helm chart.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "2.0.0"
weight: 7
weight: 19
---

Version 2.0.0 was released on August 10, 2021. The deployment pattern is changed from Helm chart to Operator.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "2.1.0"
weight: 6
weight: 18
---
Version 2.1.0 was released on October 22, 2021, the fourth release of RadonDB MySQL Kubernetes, and also the second version in operator pattern.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "2.1.1"
weight: 5
weight: 17
---

Version 2.1.1 was released on December 2, 2021.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "2.1.2"
weight: 4
weight: 16
---

Version 2.1.2 was released on February 17, 2022, comprehensively upgrading node reconstruction, addition and deletion, and so on.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "2.1.3"
weight: 3
weight: 15
---

Version 2.1.3 was released on March 24, 2022, with functional optimization and upgrade based on version 2.1.2.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "2.1.4"
weight: 2
weight: 14
---

Version 2.1.4 was released on April 7, 2022, mainly optimizing availability, adding Chinese and English documentation, and fixing some problems.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "v2.1.3"
title: "v2.2.0"
# weight从小到大排列,默认选择第一个
weight: 1
pdf: "/pdf/v2.1_en.pdf"
Expand Down
4 changes: 4 additions & 0 deletions content/en/docs/mysql/v2.2.0/feature/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Features"
weight: 4
---
147 changes: 147 additions & 0 deletions content/en/docs/mysql/v2.2.0/feature/backup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
title: "Backup and recovery"
weight: 2
---

> This feature is supported in RadonDB MySQL Kubernetes 2.1.0 and later versions.
# Quick Start

## Step 1: Install Operator.
Install the operator named `test`:

```shell
$ helm install test charts/mysql-operator
```

## Step 2: Configure backup for S3.

Add the secret file.

```yaml
kind: Secret
apiVersion: v1
metadata:
name: sample-backup-secret
namespace: default
data:
s3-endpoint: aHR0cDovL3MzLnNoMWEucWluZ3N0b3IuY29t
s3-access-key: SEdKWldXVllLSENISllFRERKSUc=
s3-secret-key: TU44TkNUdDJLdHlZREROTTc5cTNwdkxtNTlteE01blRaZlRQMWxoag==
s3-bucket: bGFsYS1teXNxbA==
type: Opaque
```
The value `s3-xxxx` is base64-encoded. You can obtain the encoded value as follows.

```shell
$ echo -n "hello"|base64
```

Create the Secret in Kubernetes.

```shell
$ kubectl create -f config/samples/backup_secret.yaml
```

Add the backupSecretName property in `mysql_v1alpha1_mysqlcluster.yaml`.

```yaml
spec:
replicas: 3
mysqlVersion: "5.7"
backupSecretName: sample-backup-secret
...
```

Create the backup file `mysql_v1alpha1_backup.yaml`.

```yaml
apiVersion: mysql.radondb.com/v1alpha1
kind: Backup
metadata:
name: backup-sample1
spec:
# Add fields here
hostname: sample-mysql-0
clustname: sample
```
| Parameter | Description |
|------|--------|
|hostname| The pod name in the cluster|
|clustname| The cluster name|

## Step 3: Start cluster.

```shell
$ kubectl apply -f config/samples/mysql_v1alpha1_mysqlcluster.yaml
```

## Step 4: Start backup.

Start the backup after the cluster is successfully started.

```shell
$ kubectl apply -f config/samples/mysql_v1alpha1_backup.yaml
```

# Uninstallation
## Uninstalling operator

Uninstall the cluster named `test`:

```shell
$ helm uninstall test
$kubectl delete -f config/samples/mysql_v1alpha1_backup.yaml
```

## Uninstalling cluster

Uninstall the cluster named `sample`:
```shell
$ kubectl delete mysqlclusters.mysql.radondb.com sample
```

## Uninstalling CRD

```shell
$ kubectl delete customresourcedefinitions.apiextensions.k8s.io mysqlclusters.mysql.radondb.com
```

## Restore of cluster from backup
Check the S3 bucket and set the `RestoreFrom` property in the **YAML** file to the backup directory, for example, `backup_2021720827`.

```yaml
...
spec:
replicas: 3
mysqlVersion: "5.7"
backupSecretName: sample-backup-secret
restoreFrom: "backup_2021720827"
...
```
Then run the following command to restore a cluster from the backup_2021720827 copy in the S3 bucket.

```shell
$ kubectl apply -f config/samples/mysql_v1alpha1_mysqlcluster.yaml
```

- To recover a cluster from an NFS server, operate as follows.

## Creating image

```shell
$ docker build -f Dockerfile.sidecar -t acekingke/sidecar:0.1 . && docker push acekingke/sidecar:0.1
$ docker build -t acekingke/controller:0.1 . && docker push acekingke/controller:0.1
```

You can replace acekingke/sidecar:0.1 with your own label.

## Deploying your own image
```shell
$ make manifests
$ make install
$ make deploy IMG=acekingke/controller:0.1 KUSTOMIZE=~/radondb-mysql-kubernetes/bin/kustomize
```
Loading

0 comments on commit a929fa4

Please sign in to comment.