forked from radondb/radondb-mysql-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Update and translate documentation. radondb#496 (radondb#505)
- Loading branch information
Showing
27 changed files
with
201 additions
and
1,630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 容器会重启. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`, 您可以修改为您自己的集群名称. | ||
Oops, something went wrong.