Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 1871f64
Author: yangon <[email protected]>
Date:   Mon Apr 1 11:14:51 2024 +0800

    Trim string (oceanbase#276)

    * fix: Trim string fields
    * fix: Disabled delete button
    * fix: Remove backup medium editing

commit b42863c
Author: yangon <[email protected]>
Date:   Sun Mar 31 13:17:23 2024 +0800

    Feat statistics (oceanbase#275)

    * feat: Statistics

    * fix: Padding ajustment

commit ccb5dbe
Author: Powerfool <[email protected]>
Date:   Fri Mar 29 14:53:05 2024 +0800

    Documentation website built with Docusaurus framework (oceanbase#273)

commit d57ad62
Author: yangon <[email protected]>
Date:   Thu Mar 28 21:13:57 2024 +0800

    Feat behaviour statistics

commit 8453102
Author: Powerfool <[email protected]>
Date:   Thu Mar 28 21:04:47 2024 +0800

    Merge from 2.2.0_release (oceanbase#272)

commit c4540ee
Author: Powerfool <[email protected]>
Date:   Thu Mar 28 19:36:50 2024 +0800

    Transform heading characters in logging sentence to uppercase (oceanbase#267)
  • Loading branch information
powerfooI committed Apr 1, 2024
1 parent 0cf955c commit 34fd42d
Show file tree
Hide file tree
Showing 199 changed files with 17,803 additions and 599 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy-docsite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master
- test-docsite
paths:
- 'docsite/**'

permissions:
contents: write

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache-dependency-path: './docsite'
- name: Install dependencies
run: cd docsite && yarn install --frozen-lockfile
- name: Build website
run: cd docsite && yarn build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./docsite/build
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include make/*

VERSION ?= 2.1.2
VERSION ?= 2.2.0
# Image URL to use all building/pushing image targets
IMG ?= oceanbase/ob-operator:${VERSION}
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
Expand Down
28 changes: 14 additions & 14 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ob-operator 是满足 Kubernetes Operator 扩展范式的自动化工具,可
ob-operator 依赖 [cert-manager](https://cert-manager.io/docs/), cert-manager 的安装可以参考对应的[安装文档](https://cert-manager.io/docs/installation/),如果您无法访问官方制品托管在 `quay.io` 镜像站的镜像,可通过下面的指令安装我们转托在 `docker.io` 中的制品:

```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/deploy/cert-manager.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.2.0_release/deploy/cert-manager.yaml
```

本例子中的 OceanBase 集群存储依赖 [local-path-provisioner](https://github.com/rancher/local-path-provisioner) 提供, 需要提前进行安装并确保其存储目的地有足够大的磁盘空间。
Expand All @@ -29,7 +29,7 @@ kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_r
* 稳定版本

```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/deploy/operator.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.2.0_release/deploy/operator.yaml
```

* 开发版本
Expand All @@ -45,7 +45,7 @@ Helm Chart 将 ob-operator 部署的命名空间进行了参数化,可在安
```shell
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm repo update
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.1.2
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.2.0
```

#### 使用 terraform
Expand Down Expand Up @@ -94,7 +94,7 @@ kubectl create secret generic root-password --from-literal=password='root_passwo
通过以下命令即可在 K8s 集群中部署 OceanBase:

```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/example/quickstart/obcluster.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.2.0_release/example/quickstart/obcluster.yaml
```

一般初始化集群需要 2 分钟左右的时间,执行以下命令,查询集群状态,当集群状态变成 running 之后表示集群创建和初始化成功:
Expand All @@ -109,7 +109,7 @@ test running 6m2s

### 连接集群

通过以下命令查找 observer 的 POD IP,POD 名的规则是 {cluster_name}-{cluster_id}-{zone}-uuid:
通过以下命令查找 observer 的 POD IP,POD 名的规则是 `${cluster_name}-${cluster_id}-${zone}-uuid`

```shell
kubectl get pods -o wide
Expand All @@ -130,7 +130,7 @@ helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard --version=0.1.0
```

![oceanbase-dashboard-install](./docs/img/oceanbase-dashboard-install.jpg)
![oceanbase-dashboard-install](./docsite/static/img/oceanbase-dashboard-install.jpg)

OceanBase Dashboard 成功安装之后, 会自动创建一个 admin 用户和随机密码,可以通过如下命令查看密码。
```
Expand All @@ -140,18 +140,18 @@ echo $(kubectl get -n default secret oceanbase-dashboard-user-credentials -o jso
```
kubectl get svc oceanbase-dashboard-ob-dashboard
```
![oceanbase-dashboard-service](./docs/img/oceanbase-dashboard-service.jpg)
![oceanbase-dashboard-service](./docsite/static/img/oceanbase-dashboard-service.jpg)

使用 admin 账号和查看到的密码登录。
![oceanbase-dashboard-overview](./docs/img/oceanbase-dashboard-overview.jpg)
![oceanbase-dashboard-overview](./docsite/static/img/oceanbase-dashboard-overview.jpg)

## 项目架构

ob-operator 以 kubebuilder 为基础,通过统一的资源管理器接口、全局的任务管理器实例以及解决长调度的任务流机制完成对 OceanBase 集群及相关应用的控制和管理。ob-operator 的架构大致如下图所示:

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

有关架构细节可参见[架构设计文档](./docs/zh_CN/arch.md)
有关架构细节可参见[架构设计文档](./docsite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer/arch.md)

## 特性

Expand Down Expand Up @@ -185,9 +185,9 @@ ob-operator 使用 [kubebuilder](https://book.kubebuilder.io/introduction) 项

## 文档

- [ob-operator 架构设计](docs/zh_CN/arch.md)
- [部署 ob-operator](docs/zh_CN/deploy.md)
- [开发手册](docs/en_US/development.md)(英文)
- [ob-operator 架构设计](docsite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer/arch.md)
- [部署 ob-operator](docsite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/developer/deploy.md)
- [开发手册](docsite/docs/developer/development.md)(英文)
- [用户手册](https://www.oceanbase.com/docs/community-ob-operator-doc-1000000000408367)

## 获取帮助
Expand All @@ -197,7 +197,7 @@ ob-operator 使用 [kubebuilder](https://book.kubebuilder.io/introduction) 项
- [GitHub Issue](https://github.com/oceanbase/ob-operator/issues)
- [官方网站](https://open.oceanbase.com/)
- [Slack](https://oceanbase.slack.com/archives/C053PT371S7)
- 钉钉群([二维码](./docs/img/dingtalk-operator-users.png)
- 钉钉群([二维码](./docsite/static/img/dingtalk-operator-users.png)
- 微信群(请添加小助手微信,微信号: OBCE666)

## 参与开发
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ob-operator relies on [cert-manager](https://cert-manager.io/docs/) for certific
If you have trouble accessing `quay.io` image registry, our mirrored cert-manager manifests can be applied through following command:

```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/deploy/cert-manager.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.2.0_release/deploy/cert-manager.yaml
```

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.
Expand All @@ -30,7 +30,7 @@ You can deploy ob-operator in a Kubernetes cluster by executing the following co
* Stable

```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/deploy/operator.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.2.0_release/deploy/operator.yaml
```

* Development
Expand All @@ -46,7 +46,7 @@ Helm Chart parameterizes the namespace in which ob-operator is deployed, allowin
```shell
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm repo update
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.1.2
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.2.0
```

#### Using terraform
Expand Down Expand Up @@ -95,7 +95,7 @@ kubectl create secret generic root-password --from-literal=password='root_passwo
You can deploy OceanBase in a Kubernetes cluster by executing the following command:

```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/example/quickstart/obcluster.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.2.0_release/example/quickstart/obcluster.yaml
```

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:
Expand All @@ -110,7 +110,7 @@ test running 6m2s

### Connecting to the OceanBase Cluster

Use the following command to find the POD IP of the observer. The naming convention for PODs is {cluster_name}-{cluster_id}-{zone}-uuid:
Use the following command to find the POD IP of the observer. The naming convention for PODs is `${cluster_name}-${cluster_id}-${zone}-uuid`:

```shell
kubectl get pods -o wide
Expand All @@ -131,7 +131,7 @@ helm repo add ob-operator https://oceanbase.github.io/ob-operator/
helm install oceanbase-dashboard ob-operator/oceanbase-dashboard --version=0.1.0
```

![oceanbase-dashboard-install](./docs/img/oceanbase-dashboard-install.jpg)
![oceanbase-dashboard-install](./docsite/static/img/oceanbase-dashboard-install.jpg)

After OceanBase Dashboard is successfully installed, a default user admin is created with a random password, you can check the password using the command printed after installation.
```
Expand All @@ -141,18 +141,18 @@ A service of type NodePort is created by default, you can check the address and
```
kubectl get svc oceanbase-dashboard-ob-dashboard
```
![oceanbase-dashboard-service](./docs/img/oceanbase-dashboard-service.jpg)
![oceanbase-dashboard-service](./docsite/static/img/oceanbase-dashboard-service.jpg)

Login with admin user and password
![oceanbase-dashboard-overview](./docs/img/oceanbase-dashboard-overview.jpg)
![oceanbase-dashboard-overview](./docsite/static/img/oceanbase-dashboard-overview.jpg)

## Project Architecture

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:

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

For more detailed information about the architecture, please refer to the [Architecture Document](./docs/en_US/arch.md).
For more detailed information about the architecture, please refer to the [Architecture Document](./docsite/docs/developer/arch.md).


## Features
Expand Down Expand Up @@ -186,8 +186,8 @@ ob-operator is built using the [kubebuilder](https://book.kubebuilder.io/introdu

## Documents

- [Architecture](docs/en_US/arch.md)
- [Contributor Guidance](docs/en_US/contributor-guidance.md)
- [Architecture](docsite/docs/developer/arch.md)
- [Contributor Guidance](docsite/docs/developer/contributor-guidance.md)
- [User Manual](https://en.oceanbase.com/docs/community-ob-operator-doc-en-10000000001123466)

## Getting Help
Expand All @@ -197,7 +197,7 @@ If you encounter any issues while using ob-operator, please feel free to seek he
- [GitHub Issue](https://github.com/oceanbase/ob-operator/issues)
- [Official Website](https://open.oceanbase.com/)
- [Slack](https://oceanbase.slack.com/archives/C053PT371S7)
- DingTalk Group ([QRCode](./docs/img/dingtalk-operator-users.png))
- DingTalk Group ([QRCode](./docsite/static/img/dingtalk-operator-users.png))
- WeChat Group (Add the assistant with WeChat ID: OBCE666)

## Contributing
Expand Down
9 changes: 4 additions & 5 deletions api/v1alpha1/obcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ var _ webhook.Defaulter = &OBCluster{}
func (r *OBCluster) Default() {
// fill default essential parameters, memory_limit, datafile_maxsize and datafile_next

obclusterlog.Info("fill in default values of obcluster")
parameterMap := make(map[string]apitypes.Parameter, 0)
memorySize, ok := r.Spec.OBServerTemplate.Resource.Memory.AsInt64()
if ok {
Expand All @@ -68,7 +67,7 @@ func (r *OBCluster) Default() {
Value: memoryLimit,
}
} else {
obclusterlog.Error(errors.New("failed to parse memory size"), "parse observer's memory size failed")
obclusterlog.Error(errors.New("Failed to parse memory size"), "parse observer's memory size failed")
}
datafileDiskSize, ok := r.Spec.OBServerTemplate.Storage.DataStorage.Size.AsInt64()
if ok {
Expand All @@ -83,7 +82,7 @@ func (r *OBCluster) Default() {
Value: datafileNextSize,
}
} else {
obclusterlog.Error(errors.New("failed to parse datafile size"), "parse observer's datafile size failed")
obclusterlog.Error(errors.New("Failed to parse datafile size"), "parse observer's datafile size failed")
}
parameterMap["enable_syslog_recycle"] = apitypes.Parameter{
Name: "enable_syslog_recycle",
Expand Down Expand Up @@ -304,7 +303,7 @@ func (r *OBCluster) validateMutation() error {
if err != nil {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("parameters"), "memory limit size", "Failed to parse memory limit"))
} else if memoryLimit.AsApproximateFloat64() > r.Spec.OBServerTemplate.Resource.Memory.AsApproximateFloat64() {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("parameters"), "memory limit size overflow", "memory limit exceeds observer's resource"))
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("parameters"), "memory limit size overflow", "Memory limit exceeds observer's resource"))
}

if r.Spec.OBServerTemplate.Storage.DataStorage.Size.AsApproximateFloat64() < 3*memoryLimit.AsApproximateFloat64() {
Expand All @@ -323,7 +322,7 @@ func (r *OBCluster) validateMutation() error {
if err != nil {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("parameters"), "datafile max size", "Failed to parse datafile max size"))
} else if datafileMax.AsApproximateFloat64() > r.Spec.OBServerTemplate.Storage.DataStorage.Size.AsApproximateFloat64() {
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("parameters"), "datafile max size overflow", "datafile maxsize exceeds observer's data storage size"))
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("parameters"), "datafile max size overflow", "Datafile maxsize exceeds observer's data storage size"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/obtenantoperation_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (r *OBTenantOperation) Default() {
Name: secondaryTenantName,
}, secondaryTenant)
if err != nil {
obtenantoperationlog.Error(err, "get tenant")
// obtenantoperationlog.Error(err, "get tenant")
return
}
secondMeta := secondaryTenant.GetObjectMeta()
Expand Down
4 changes: 2 additions & 2 deletions charts/ob-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: 2.1.2
appVersion: 2.2.0
description: A Helm chart for OB-Operator
name: ob-operator
type: application
version: 2.1.2
version: 2.2.0
2 changes: 1 addition & 1 deletion charts/ob-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12713,7 +12713,7 @@ spec:
- --log-verbosity=0
command:
- /manager
image: oceanbase/ob-operator:2.1.2
image: oceanbase/ob-operator:2.2.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
Loading

0 comments on commit 34fd42d

Please sign in to comment.