Skip to content

Commit

Permalink
docs: fix format and link bugs and add rabbitmq docs (#8485)
Browse files Browse the repository at this point in the history
  • Loading branch information
michelle-0808 authored Nov 28, 2024
1 parent 61eb47e commit 27193a7
Show file tree
Hide file tree
Showing 17 changed files with 853 additions and 571 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,18 @@ apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ops-expose-enable
namespace: demo
spec:
clusterRef: mycluster
clusterName: mycluster
expose:
- componentName: mysql
services:
- annotations:
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: intranet
ipFamilyPolicy: PreferDualStack
name: vpc
- name: vpc
roleSelector: leader
serviceType: LoadBalancer
switch: Enable
ttlSecondsBeforeAbort: 0
preConditionDeadlineSeconds: 0
type: Expose
EOF
```
</TabItem>
Expand Down Expand Up @@ -139,20 +137,18 @@ apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ops-expose-disable
namespace: demo
spec:
clusterRef: mycluster
clusterName: mycluster
expose:
- componentName: mysql
services:
- annotations:
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: intranet
ipFamilyPolicy: PreferDualStack
name: vpc
- name: vpc
roleSelector: leader
serviceType: LoadBalancer
switch: Disable
ttlSecondsBeforeAbort: 0
preConditionDeadlineSeconds: 0
type: Expose
EOF
```
</TabItem>
Expand Down Expand Up @@ -186,20 +182,18 @@ apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ops-expose-enable
namespace: demo
spec:
clusterRef: mycluster
clusterName: mycluster
expose:
- componentName: mysql
services:
- annotations:
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: internet
ipFamilyPolicy: PreferDualStack
name: internet
- name: internet
roleSelector: leader
serviceType: LoadBalancer
switch: Enable
ttlSecondsBeforeAbort: 0
preConditionDeadlineSeconds: 0
type: Expose
EOF
```
</TabItem>
Expand All @@ -223,20 +217,18 @@ apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ops-expose-disable
namespace: demo
spec:
clusterRef: mycluster
clusterName: mycluster
expose:
- componentName: mysql
services:
- annotations:
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: internet
ipFamilyPolicy: PreferDualStack
name: internet
- name: internet
roleSelector: leader
serviceType: LoadBalancer
switch: Disable
ttlSecondsBeforeAbort: 0
preConditionDeadlineSeconds: 0
type: Expose
EOF
```
</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import TabItem from '@theme/TabItem';

KubeBlocks is Kubernetes-native, you can use Helm or kubectl with a YAML file to install it.

To try out KubeBlocks on your local host, you can use the [Playground](./../../try-out-on-playground/try-kubeblocks-on-your-laptop.md) or [create a local Kubernetes test cluster first](./../prerequisite/prepare-a-local-k8s-cluster.md) and then follow the steps in this tutorial to install KubeBlocks.
To try out KubeBlocks on your local host, you can use the [Playground](./../../try-out-on-playground/try-kubeblocks-on-your-laptop.md) or [create a local Kubernetes test cluster first](./../prepare-a-local-k8s-cluster/prepare-a-local-k8s-cluster.md) and then follow the steps in this tutorial to install KubeBlocks.

:::note

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_label: Install KubeBlocks

The quickest way to try out KubeBlocks is to create a new Kubernetes cluster and install KubeBlocks using the playground. However, production environments are more complex, with applications running in different namespaces and with resource or permission limitations. This document explains how to deploy KubeBlocks on an existing Kubernetes cluster.

To try out KubeBlocks on your local host, you can use the [Playground](./../../try-out-on-playground/try-kubeblocks-on-your-laptop.md) or [create a local Kubernetes test cluster first](./../prerequisite/prepare-a-local-k8s-cluster.md) and then follow the steps in this tutorial to install KubeBlocks.
To try out KubeBlocks on your local host, you can use the [Playground](./../../try-out-on-playground/try-kubeblocks-on-your-laptop.md) or [create a local Kubernetes test cluster first](./../prepare-a-local-k8s-cluster/prepare-a-local-k8s-cluster.md) and then follow the steps in this tutorial to install KubeBlocks.

## Environment preparation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,24 @@ kbcli cluster expose ${cluster-name} --type vpc --enable=true

此处以 MySQL 集群为例,在阿里云上为集群暴露 VPC 访问地址的方式如下:

```bash
```yaml
kubectl apply -f - <<EOF
apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ops-expose-enable
namespace: demo
spec:
clusterRef: mycluster
clusterName: mycluster
expose:
- componentName: mysql
services:
- annotations:
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: intranet
ipFamilyPolicy: PreferDualStack
name: vpc
- name: vpc
roleSelector: leader
serviceType: LoadBalancer
switch: Enable
ttlSecondsBeforeAbort: 0
preConditionDeadlineSeconds: 0
type: Expose
EOF
```
</TabItem>
Expand All @@ -136,26 +134,24 @@ kbcli cluster expose ${cluster-name} --type vpc --enable=false

<TabItem value="kubectl" label="kubeclt">

```bash
```yaml
kubectl apply -f - <<EOF
apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ops-expose-disable
namespace: demo
spec:
clusterRef: mycluster
clusterName: mycluster
expose:
- componentName: mysql
services:
- annotations:
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: intranet
ipFamilyPolicy: PreferDualStack
name: vpc
- name: vpc
roleSelector: leader
serviceType: LoadBalancer
switch: Disable
ttlSecondsBeforeAbort: 0
preConditionDeadlineSeconds: 0
type: Expose
EOF
```
</TabItem>
Expand Down Expand Up @@ -192,26 +188,25 @@ kbcli cluster expose ${cluster-name} --type internet --enable=true

以 MySQL 集群为例,在阿里云上为集群暴露公网访问地址的方式如下:

```bash
```yaml
kubectl apply -f - <<EOF
apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ops-expose-enable
namespace: demo
spec:
clusterRef: mycluster
clusterName: mycluster
expose:
- componentName: mysql
services:
- annotations:
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: internet
ipFamilyPolicy: PreferDualStack
name: internet
- name: internet
roleSelector: leader
serviceType: LoadBalancer
switch: Enable
ttlSecondsBeforeAbort: 0
preConditionDeadlineSeconds: 0
type: Expose
EOF
```
```

</TabItem>
Expand All @@ -238,26 +233,24 @@ kbcli cluster expose ${cluster-name} --type internet --enable=false

<TabItem value="kubectl" label="kubeclt">

```bash
```yaml
kubectl apply -f - <<EOF
apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ops-expose-disable
namespace: demo
spec:
clusterRef: mycluster
clusterName: mycluster
expose:
- componentName: mysql
services:
- annotations:
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-address-type: internet
ipFamilyPolicy: PreferDualStack
name: internet
- name: internet
roleSelector: leader
serviceType: LoadBalancer
switch: Disable
ttlSecondsBeforeAbort: 0
preConditionDeadlineSeconds: 0
type: Expose
EOF
```

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ KubeBlocks 通过插件(Addon)机制支持多种数据库引擎。部署 Kub
- [ApeCloud MySQL](./../kubeblocks-for-apecloud-mysql/cluster-management/create-and-connect-an-apecloud-mysql-cluster.md)
- [MySQL 社区版](./../kubeblocks-for-mysql-community-edition/cluster-management/create-and-connect-a-mysql-cluster.md)
- [PostgreSQL](./../kubeblocks-for-postgresql/cluster-management/create-and-connect-a-postgresql-cluster.md)
- [Redis](./../kubeblocks-for-redis/cluster-management/create-and-connect-a-redis-cluster.md)
- [Redis](./../kubeblocks-for-redis/cluster-management/create-and-connect-to-a-redis-cluster.md)
- [MongoDB](./../kubeblocks-for-mongodb/cluster-management/create-and-connect-to-a-mongodb-cluster.md)
- [Kafka](./../kubeblocks-for-kafka/cluster-management/create-a-kafka-cluster.md)
- [Pulsar](./../kubeblocks-for-pulsar/cluster-management/create-pulsar-cluster-on-kubeblocks.md)
- [Pulsar](./../kubeblocks-for-pulsar/cluster-management/create-pulsar-cluster-on-kb.md)
- [RabbitMQ](./../kubeblocks-for-rabbitmq/manage-rabbitmq.md)
- [Elasticsearch](./../kubeblocks-for-elasticsearch/manage-elasticsearch.md)
- [StarRocks](./../kubeblocks-for-starrocks/manage-starrocks.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import TabItem from '@theme/TabItem';

KubeBlocks 是 Kubernetes 原生 operator,可通过 Helm 或者 kubectl 应用 YAML 文件安装 KubeBlocks。本文将介绍如何在现有的 Kubernetes 集群上部署 KubeBlocks。

如果您想要在本地环境试用 KubeBlocks,可通过 [Playground](./../../try-out-on-playground/try-kubeblocks-on-local-host.md) 试用,或者[先在本地创建 Kubernetes 测试集群](./../prerequisite/prepare-a-local-k8s-cluster.md),然后按照本文操作步骤安装 KubeBlocks。
如果您想要在本地环境试用 KubeBlocks,可通过 [Playground](./../../try-out-on-playground/try-kubeblocks-on-local-host.md) 试用,或者[先在本地创建 Kubernetes 测试集群](./../prepare-a-local-k8s-cluster/prepare-a-local-k8s-cluster.md),然后按照本文操作步骤安装 KubeBlocks。

:::note

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_label: 用 kbcli 安装 KubeBlocks

使用 Playground 创建一个新的 Kubernetes 集群并安装 KubeBlocks,是快速上手的一种方法。然而,在实际生产环境中,情况会复杂得多,应用程序在不同的命名空间中运行,还存在资源或权限限制。本文档将介绍如何在现有的 Kubernetes 集群上部署 KubeBlocks。

如果您想要在本地环境试用 KubeBlocks,可通过 [Playground](./../../try-out-on-playground/try-kubeblocks-on-local-host.md) 试用,或者[先在本地创建 Kubernetes 测试集群](./../prerequisite/prepare-a-local-k8s-cluster.md),然后按照本文操作步骤安装 KubeBlocks。
如果您想要在本地环境试用 KubeBlocks,可通过 [Playground](./../../try-out-on-playground/try-kubeblocks-on-local-host.md) 试用,或者[先在本地创建 Kubernetes 测试集群](./../prepare-a-local-k8s-cluster/prepare-a-local-k8s-cluster.md),然后按照本文操作步骤安装 KubeBlocks。

## 环境准备

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ EOF

| 字段 | 定义 |
|---------------------------------------|--------------------------------------|
| `spec.terminationPolicy` | 集群的终止策略,默认值为 `Delete`,有效值为 `DoNotTerminate``Halt``Delete``WipeOut`<p> - `DoNotTerminate` 会阻止删除操作。 </p><p> - `Halt` 会删除工作负载资源,如 statefulset 和 deployment 等,但是保留了 PVC 。 </p><p> - `Delete``Halt` 的基础上进一步删除了 PVC。 </p><p> - `WipeOut``Delete` 的基础上从备份存储的位置完全删除所有卷快照和快照数据。 </p>|
| `spec.terminationPolicy` | 集群的终止策略,默认值为 `Delete`,有效值为 `DoNotTerminate``Halt``Delete``WipeOut`具体定义可参考 [终止策略](#终止策略)|
| `spec.affinity` | 为集群的 Pods 定义了一组节点亲和性调度规则。该字段可控制 Pods 在集群中节点上的分布。 |
| `spec.affinity.podAntiAffinity` | 定义了不在同一 component 中的 Pods 的反亲和性水平。该字段决定了 Pods 以何种方式跨节点分布,以提升可用性和性能。 |
| `spec.affinity.topologyKeys` | 用于定义 Pod 反亲和性和 Pod 分布约束的拓扑域的节点标签值。 |
Expand Down Expand Up @@ -944,3 +944,80 @@ KubeBlocks 支持重启集群中的所有 Pod。当数据库出现异常时,
</TabItem>
</Tabs>
## 删除集群
### 终止策略
:::note
终止策略决定了删除集群的方式。
:::
| **终止策略** | **删除操作** |
|:----------------------|:-------------------------------------------------------------------------------------------|
| `DoNotTerminate` | `DoNotTerminate` 禁止删除操作。 |
| `Halt` | `Halt` 删除集群资源(如 Pods、Services 等),但保留 PVC。停止其他运维操作的同时,保留了数据。但 `Halt` 策略在 v0.9.1 中已删除,设置为 `Halt` 的效果与 `DoNotTerminate` 相同。 |
| `Delete` | `Delete``Halt` 的基础上,删除 PVC 及所有持久数据。 |
| `WipeOut` | `WipeOut` 删除所有集群资源,包括外部存储中的卷快照和备份。使用该策略将会删除全部数据,特别是在非生产环境,该策略将会带来不可逆的数据丢失。请谨慎使用。 |
执行以下命令查看终止策略。
<Tabs>
<TabItem value="kubectl" label="kubectl" default>
```bash
kubectl get cluster mycluster -n demo
>
NAME CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS AGE
mycluster Delete Running 4m29s
```
</TabItem>
<TabItem value="kbcli" label="kbcli">
```bash
kbcli cluster list mycluster -n demo
>
NAME NAMESPACE CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS CREATED-TIME
mycluster demo Delete Running Sep 27,2024 11:42 UTC+0800
```
</TabItem>
</Tabs>
### 步骤
执行以下命令,删除集群。
<Tabs>
<TabItem value="kubectl" label="kubectl" default>
```bash
kubectl delete cluster mycluster -n demo
```
如果想删除集群和所有相关资源,可以将终止策略修改为 `WipeOut`,然后再删除该集群。
```bash
kubectl patch -n demo cluster mycluster -p '{"spec":{"terminationPolicy":"WipeOut"}}' --type="merge"
kubectl delete -n demo cluster mycluster
```
</TabItem>
<TabItem value="kbcli" label="kbcli">
```bash
kbcli cluster delete mycluster -n demo
```
</TabItem>
</Tabs>
4 changes: 4 additions & 0 deletions i18n/zh-cn/user-docs/kubeblocks-for-rabbitmq/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
position: 21
label: KubeBlocks for RabbitMQ
collapsible: true
collapsed: true
Loading

0 comments on commit 27193a7

Please sign in to comment.