Skip to content

Commit

Permalink
docs: Update and translate documentation. #496
Browse files Browse the repository at this point in the history
  • Loading branch information
acekingke committed Jun 7, 2022
1 parent b3e4120 commit 20bd471
Show file tree
Hide file tree
Showing 27 changed files with 201 additions and 1,630 deletions.
2 changes: 1 addition & 1 deletion docs/en-us/deploy_backup_restore_nfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ kubectl get svc nfs-server --template={{.spec.clusterIP}}

```yaml
# config/samples/mysql_v1alpha1_backup.yaml
NFSServerAddress: "10.96.253.82"
nfsServerAddress: "10.96.253.82"
```
### 2. Create a backup
Expand Down
91 changes: 0 additions & 91 deletions docs/en-us/setup-rw-svc.md

This file was deleted.

23 changes: 23 additions & 0 deletions docs/zh-cn/DebugMode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Contents
=============
* [Debug模式](#debug模式)
* [移除debug模式](#移除debug模式)


# Debug 模式

在运维阶段, 如果你想避免restart-on-fail循环的 mysql 容器,你应该使用 Debug 模式。只要创建一个空文件 `/var/lib/mysql/sleep-forever` 即可.

示例:

```bash
kubectl exec -it sample-mysql-0 -c mysql -- sh -c 'touch /var/lib/mysql/sleep-forever'
```
该命令会让 Pod `sample-mysql-0` 的 mysql 容器在 mysqld 已经crash的情况下, 永远不会重启.

# 移除 Debug 模式

```bash
kubectl exec -it sample-mysql-0 -c mysql -- sh -c 'rm /var/lib/mysql/sleep-forever'
```
该命令会让 Pod `sample-mysql-0` 的 mysql 恢复正常情况, 即 mysqld 退出后, mysql 容器会重启.
46 changes: 46 additions & 0 deletions docs/zh-cn/build_images_and_apply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## 如何创建自己的镜像
* [Operator](#operator)
* [Sidecar](#sidecar)

### Operator

1. 创建自己的镜像并上传到docker hub上.

```
docker build -t {your repo}/mysql-operator:{your tag} . && docker push {your repo}/mysql-operator:{your tag}
```

2. 添加 radondb mysql 的 helm 库.

```
helm repo add radondb https://radondb.github.io/radondb-mysql-kubernetes/
```

3. 使用自己的镜像来安装/更新 operator.

```
helm upgrade demo radondb/mysql-operator --install --set manager.image={your repo}/mysql-operator --set manager.tag={your tag}
```

### Sidecar

1. 创建自己的 sidecar 镜像并 push 到 docker hub 中.

```
docker build -f Dockerfile.sidecar -t {your repo}/mysql-sidecar:{your tag} . && docker push {your repo}/mysql-sidecar:{your tag}
```

2. 创建sample cluster.

```
kubectl apply -f https://github.com/radondb/radondb-mysql-kubernetes/releases/latest/download/mysql_v1alpha1_mysqlcluster.yaml
```

3. 从已有的 cluster 中应用自己的镜像.

```
kubectl patch mysql sample -p '{"spec": {"podPolicy": {"sidecarImage": "{your repo}/mysql-sidecar:{your tag}"}}}' --type=merge
```

> 本例中集群名称为 `sample`, 您可以修改为您自己的集群名称.
Loading

0 comments on commit 20bd471

Please sign in to comment.