Skip to content

Commit 231c13f

Browse files
committed
Merge branch 'master' of github.com:oceanbase/ob-operator into wt-dev-clusterDetail
2 parents 12bd98a + fed6c3a commit 231c13f

File tree

103 files changed

+1444
-320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1444
-320
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include make/*
22

3-
VERSION ?= 2.3.0
3+
VERSION ?= 2.3.1
44
# Image URL to use all building/pushing image targets
55
IMG ?= quay.io/oceanbase/ob-operator:${VERSION}
66
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.

README-CN.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ob-operator 是满足 Kubernetes Operator 扩展范式的自动化工具,可
1515
ob-operator 依赖 [cert-manager](https://cert-manager.io/docs/), cert-manager 的安装可以参考对应的[安装文档](https://cert-manager.io/docs/installation/),如果您无法访问官方制品托管在 `quay.io` 镜像站的镜像,可通过下面的指令安装我们转托在 `docker.io` 中的制品:
1616

1717
```shell
18-
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.0_release/deploy/cert-manager.yaml
18+
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.1_release/deploy/cert-manager.yaml
1919
```
2020

2121
本例子中的 OceanBase 集群存储依赖 [local-path-provisioner](https://github.com/rancher/local-path-provisioner) 提供, 需要提前进行安装并确保其存储目的地有足够大的磁盘空间。如果您计划在生产环境部署,推荐使用其他的存储解决方案。我们在[存储兼容性](#存储兼容性)一节提供了我们测试过的存储兼容性结果。
@@ -29,7 +29,7 @@ kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.0_r
2929
- 稳定版本
3030

3131
```shell
32-
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.0_release/deploy/operator.yaml
32+
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.1_release/deploy/operator.yaml
3333
```
3434

3535
- 开发版本
@@ -97,7 +97,7 @@ kubectl create secret generic root-password --from-literal=password='root_passwo
9797
通过以下命令即可在 K8s 集群中部署 OceanBase:
9898

9999
```shell
100-
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.0_release/example/quickstart/obcluster.yaml
100+
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.1_release/example/quickstart/obcluster.yaml
101101
```
102102

103103
一般初始化集群需要 2 分钟左右的时间,执行以下命令,查询集群状态,当集群状态变成 running 之后表示集群创建和初始化成功:
@@ -162,6 +162,8 @@ ob-operator 以 kubebuilder 为基础,通过统一的资源管理器接口、
162162

163163
![ob-operator 架构设计](./docsite/static/img/ob-operator-arch.png)
164164

165+
![ob-operator 任务管理器](./docsite/static/img/ob-operator-task-manager-arch.png)
166+
165167
有关架构细节可参见[架构设计文档](https://oceanbase.github.io/ob-operator/zh-Hans/docs/developer/arch)
166168

167169
## 特性
@@ -225,6 +227,7 @@ ob-operator 使用 [kubebuilder](https://book.kubebuilder.io/introduction) 项
225227
## 参与开发
226228

227229
- [提出 Issue](https://github.com/oceanbase/ob-operator/issues)
230+
- [发起 Discussion](https://github.com/oceanbase/ob-operator/discussions)
228231
- [发起 Pull request](https://github.com/oceanbase/ob-operator/pulls)
229232

230233
## 许可证

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ob-operator relies on [cert-manager](https://cert-manager.io/docs/) for certific
1616
If you have trouble accessing `quay.io` image registry, our mirrored cert-manager manifests can be applied through following command:
1717

1818
```shell
19-
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.0_release/deploy/cert-manager.yaml
19+
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.1_release/deploy/cert-manager.yaml
2020
```
2121

2222
Storage of OceanBase cluster in this example relies on [local-path-provisioner](https://github.com/rancher/local-path-provisioner), which should be installed beforehand. You should confirm that there is enough disk space in storage destination of local-path-provisioner. If you decide to deploy OceanBase cluster in production environment, it is recommended to use other storage solutions. We have provided a compatible table for storage solutions that we tested in section [Storage Compatibility](#storage-compatibility).
@@ -30,7 +30,7 @@ You can deploy ob-operator in a Kubernetes cluster by executing the following co
3030
- Stable
3131

3232
```shell
33-
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.0_release/deploy/operator.yaml
33+
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.1_release/deploy/operator.yaml
3434
```
3535

3636
- Development
@@ -98,7 +98,7 @@ kubectl create secret generic root-password --from-literal=password='root_passwo
9898
You can deploy OceanBase in a Kubernetes cluster by executing the following command:
9999

100100
```shell
101-
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.0_release/example/quickstart/obcluster.yaml
101+
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.3.1_release/example/quickstart/obcluster.yaml
102102
```
103103

104104
It generally takes around 2 minutes to bootstrap a cluster. Execute the following command to check the status of the cluster. Once the cluster status changes to "running," it indicates that the cluster has been successfully created and bootstrapped:
@@ -160,10 +160,12 @@ Login with admin user and password.
160160

161161
## Project Architecture
162162

163-
ob-operator is built on top of kubebuilder and provides control and management of OceanBase clusters and related applications through a unified resource manager interface, a global task manager instance, and a task flow mechanism for handling long-running tasks. The architecture diagram is approximately as follows:
163+
ob-operator is built on top of kubebuilder and provides control and management of OceanBase clusters and related applications through a unified resource manager interface, a global task manager instance, and a task flow mechanism for handling long-running tasks. The architecture diagram of ob-operator is approximately as follows:
164164

165165
![ob-operator Architecture](./docsite/static/img/ob-operator-arch.png)
166166

167+
![ob-operator Task Manager Architecture](./docsite/static/img/ob-operator-task-manager-arch.png)
168+
167169
For more detailed information about the architecture, please refer to the [Architecture Document](https://oceanbase.github.io/ob-operator/docs/developer/arch).
168170

169171
## Features
@@ -212,6 +214,8 @@ ob-operator is built using the [kubebuilder](https://book.kubebuilder.io/introdu
212214
- [Contributor Guidance](https://oceanbase.github.io/ob-operator/docs/developer/contributor-guidance)
213215
- [User Manual](https://oceanbase.github.io/ob-operator/docs/manual/what-is-ob-operator)
214216

217+
github.com/oceanbase/ob-operator + /docs/developer/arch
218+
215219
## Getting Help
216220

217221
If you encounter any issues while using ob-operator, please feel free to seek help through the following channels:
@@ -227,7 +231,8 @@ If you encounter any issues while using ob-operator, please feel free to seek he
227231
## Contributing
228232

229233
- [Submit an issue](https://github.com/oceanbase/ob-operator/issues)
230-
- [Create a Pull request](https://github.com/oceanbase/ob-operator/pulls)
234+
- [Create a discussion](https://github.com/oceanbase/ob-operator/discussions)
235+
- [Create a pull request](https://github.com/oceanbase/ob-operator/pulls)
231236

232237
## License
233238

api/v1alpha1/observer_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func (s *OBServer) SupportStaticIP() bool {
108108
switch s.Status.CNI {
109109
case oceanbaseconst.CNICalico:
110110
return true
111+
case oceanbaseconst.CNIKubeOvn:
112+
return true
111113
default:
112114
annos := s.GetAnnotations()
113115
if annos == nil {

api/v1alpha1/obtenant_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ func (r *OBTenant) validateMutation() error {
290290
if r.Spec.Source != nil && r.Spec.Source.Restore != nil {
291291
res := r.Spec.Source.Restore
292292

293-
if res.ArchiveSource == nil && res.BakDataSource == nil && res.SourceUri == "" {
293+
if (res.ArchiveSource == nil || res.BakDataSource == nil) && res.SourceUri == "" {
294294
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("source").Child("restore"), res, "Restore must have a source option, but both archiveSource, bakDataSource and sourceUri are nil now"))
295-
} else {
295+
} else if res.ArchiveSource != nil && res.BakDataSource != nil {
296296
destErrs := errors.Join(
297297
validateBackupDestination(cluster, res.ArchiveSource, "spec", "source", "restore", "archiveSource"),
298298
validateBackupDestination(cluster, res.BakDataSource, "spec", "source", "restore", "bakDataSource"),

charts/ob-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
2-
appVersion: 2.3.0
2+
appVersion: 2.3.1
33
description: A Helm chart for OB-Operator
44
name: ob-operator
55
type: application
6-
version: 2.3.0
6+
version: 2.3.1

charts/ob-operator/templates/operator.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6779,11 +6779,19 @@ spec:
67796779
- jsonPath: .status.status
67806780
name: Status
67816781
type: string
6782+
- jsonPath: .spec.clusterName
6783+
name: ClusterName
6784+
type: string
67826785
- jsonPath: .metadata.creationTimestamp
67836786
name: Age
67846787
type: date
6785-
- jsonPath: .spec.clusterName
6786-
name: ClusterName
6788+
- jsonPath: .spec.observer.image
6789+
name: Image
6790+
priority: 1
6791+
type: string
6792+
- jsonPath: .spec.observer.storage
6793+
name: Storage
6794+
priority: 1
67876795
type: string
67886796
- jsonPath: .status.operationContext.tasks
67896797
name: Tasks
@@ -21794,7 +21802,7 @@ spec:
2179421802
- --log-verbosity=0
2179521803
command:
2179621804
- /manager
21797-
image: quay.io/oceanbase/ob-operator:2.3.0
21805+
image: quay.io/oceanbase/ob-operator:2.3.1
2179821806
livenessProbe:
2179921807
httpGet:
2180021808
path: /healthz

config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ kind: Kustomization
55
images:
66
- name: controller
77
newName: quay.io/oceanbase/ob-operator
8-
newTag: 2.3.0
8+
newTag: 2.3.1

deploy/operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21815,7 +21815,7 @@ spec:
2181521815
- --log-verbosity=0
2181621816
command:
2181721817
- /manager
21818-
image: quay.io/oceanbase/ob-operator:2.3.0
21818+
image: quay.io/oceanbase/ob-operator:2.3.1
2181921819
livenessProbe:
2182021820
httpGet:
2182121821
path: /healthz

docsite/docs/developer/arch.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,22 @@ ob-operator follows the [Operator pattern of Kubernetes](https://kubernetes.io/d
1212
* OBCluster: Represents an OceanBase cluster.
1313
* OBZone: Represents an OceanBase zone that belongs to an OBCluster.
1414
* OBServer: Represents an OceanBase observer resource that belongs to an OBZone.
15-
* OBParameter: Represents cluster parameters.
15+
* OBParameter: Represents cluster and tenant parameters.
1616
* OBTenant: Represents a tenant in the OceanBase cluster, which belongs to an OBCluster.
1717
* OBTenantBackupPolicy: Represents a scheduling backup policy for a tenant.
1818
* OBTenantBackup: Represents a backup task for a tenant.
1919
* OBTenantRestore: Represents a restore task for a tenant.
2020
* OBTenantOperation: Represents operational tasks for a tenant.
21+
* OBTenantVariable: Represents tenant variables.
22+
* OBClusterOperation: Represents operational tasks for a cluster.
23+
* OBResourceRescue: Represents a resource rescue task, which is used to recover resources that are stuck in an error state.
24+
* K8sCluster: Represents a Kubernetes cluster that is managed by ob-operator.
25+
26+
## Diagram
27+
28+
The following diagram illustrates layers of ob-operator and the relationship among the custom resources.
29+
30+
![ob-operator architecture](/img/ob-operator-arch.png)
2131

2232
## Resource Manager
2333

@@ -66,4 +76,4 @@ To address this issue, ob-operator adopts task flow mechanism and a global task
6676

6777
The relationship among the control loop, resource manager, and task manager is depicted in the following figure.
6878

69-
![The relationship among the control loop, resource manager, and task manager](/img/ob-operator-arch.png)
79+
![The relationship among the control loop, resource manager, and task manager](/img/ob-operator-task-manager-arch.png)

0 commit comments

Comments
 (0)