Skip to content

Commit

Permalink
Merge from 2.2.0_release (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI authored Mar 28, 2024
1 parent c4540ee commit 8453102
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 37 deletions.
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
8 changes: 4 additions & 4 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 Down
8 changes: 4 additions & 4 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 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
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: oceanbase/ob-operator
newTag: 2.1.2
newTag: 2.2.0
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12733,7 +12733,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
6 changes: 3 additions & 3 deletions docs/en_US/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ ob-operator supports deployment using Helm. Before deploying ob-operator with th

```shell
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
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
```

Parameters:

* namespace: Namespace, can be customized. It is recommended to use "oceanbase-system" as the namespace.

* version: ob-operator version number. It is recommended to use the latest version `2.1.2`.
* version: ob-operator version number. It is recommended to use the latest version `2.2.0`.

## 2.2 Deploying with Configuration Files

* 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
```shell
Expand Down
6 changes: 3 additions & 3 deletions docs/zh_CN/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ ob-operator 支持通过 Helm 进行部署,在使用 Helm 命令部署 ob-oper

```shell
helm repo add ob-operator https://oceanbase.github.io/ob-operator/
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
```

参数说明:

* namespace:命名空间,可自定义,一般建议使用 oceanbase-system。

* version:ob-operator 版本号,建议使用最新的版本 `2.1.2`
* version:ob-operator 版本号,建议使用最新的版本 `2.2.0`

## 2.2 使用配置文件部署

* 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
```shell
Expand Down
12 changes: 7 additions & 5 deletions internal/dashboard/generated/bindata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/dashboard/middleware/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func LoginRequired() gin.HandlerFunc {
session.Options(sessions.Options{Path: "/", MaxAge: -1}) // this sets the cookie with a MaxAge of 0
err := session.Save()
if err != nil {
log.Errorf("failed to save session: %v", err)
log.Errorf("Failed to save session: %v", err)
c.AbortWithStatusJSON(500, gin.H{
"message": "failed to save session",
})
Expand All @@ -88,7 +88,7 @@ func RefreshExpiration() gin.HandlerFunc {
session.Set("expiration", expiration.Unix())
err := session.Save()
if err != nil {
log.Errorf("failed to save session: %v", err)
log.Errorf("Failed to save session: %v", err)
c.AbortWithStatusJSON(500, gin.H{
"message": "failed to save session",
})
Expand Down
10 changes: 5 additions & 5 deletions internal/resource/observer/observer_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func WaitOBClusterBootstrapped(m *OBServerManager) tasktypes.TaskError {
}

func CreateOBPod(m *OBServerManager) tasktypes.TaskError {
m.Logger.V(oceanbaseconst.LogLevelDebug).Info("create observer pod")
m.Logger.V(oceanbaseconst.LogLevelDebug).Info("Create observer pod")
obcluster, err := m.getOBCluster()
if err != nil {
return errors.Wrap(err, "Get obcluster from K8s")
Expand Down Expand Up @@ -218,7 +218,7 @@ func CreateOBPVC(m *OBServerManager) tasktypes.TaskError {
}

func DeleteOBServerInCluster(m *OBServerManager) tasktypes.TaskError {
m.Logger.V(oceanbaseconst.LogLevelDebug).Info("delete observer in cluster")
m.Logger.V(oceanbaseconst.LogLevelDebug).Info("Delete observer in cluster")
operationManager, err := m.getOceanbaseOperationManager()
if err != nil {
return errors.Wrapf(err, "Get oceanbase operation manager failed")
Expand Down Expand Up @@ -297,7 +297,7 @@ func WaitOBServerPodReady(m *OBServerManager) tasktypes.TaskError {
}
}
if observerPodRestarted {
m.Logger.Info("observer pod restarted")
m.Logger.Info("OBServer pod restarted")
break
}
time.Sleep(time.Second)
Expand All @@ -312,7 +312,7 @@ func WaitOBServerActiveInCluster(m *OBServerManager) tasktypes.TaskError {
if m.OBServer.SupportStaticIP() {
return nil
}
m.Logger.Info("wait observer active in cluster")
m.Logger.Info("Wait for observer to be active in cluster")
observerInfo := &model.ServerInfo{
Ip: m.OBServer.Status.GetConnectAddr(),
Port: oceanbaseconst.RpcPort,
Expand Down Expand Up @@ -347,7 +347,7 @@ func WaitOBServerDeletedInCluster(m *OBServerManager) tasktypes.TaskError {
if m.OBServer.SupportStaticIP() {
return nil
}
m.Logger.Info("wait observer deleted in cluster")
m.Logger.Info("Wait for observer to be deleted in cluster")
observerInfo := &model.ServerInfo{
Ip: m.OBServer.Status.GetConnectAddr(),
Port: oceanbaseconst.RpcPort,
Expand Down
4 changes: 2 additions & 2 deletions internal/resource/observer/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (m *OBServerManager) setRecoveryStatus() {
m.Logger.Info("Current server can keep static ip address or the cluster runs as standalone, recover by recreating pod")
m.OBServer.Status.Status = serverstatus.Recover
} else {
m.Logger.Info("observer not recoverable, delete current observer and wait recreate")
m.Logger.Info("OBServer is not recoverable, delete current observer and wait recreate")
m.OBServer.Status.Status = serverstatus.Unrecoverable
}
}
Expand Down Expand Up @@ -481,7 +481,7 @@ func (m *OBServerManager) createOBServerContainer(obcluster *v1alpha1.OBCluster)
svc, err := m.getSvc()
if err != nil {
if kubeerrors.IsNotFound(err) {
m.Logger.Info("svc not found")
m.Logger.Info("Svc not found")
} else {
m.Logger.Error(err, "Failed to get svc")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/oceanbase-sdk/const/config/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ import (
)

const (
BootstrapTimeout = 600 * time.Second
BootstrapTimeout = 1800 * time.Second
)
4 changes: 2 additions & 2 deletions pkg/oceanbase-sdk/operation/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ func (m *OceanbaseOperationManager) WaitTenantLocalityChangeFinished(name string
m.Logger.Error(err, "Failed to get tenant info")
}
if tenant.PreviousLocality == "" {
m.Logger.V(oceanbaseconst.LogLevelTrace).Info("tenant locality change finished", "tenant name", name)
m.Logger.V(oceanbaseconst.LogLevelTrace).Info("Tenant locality change finished", "tenant name", name)
finished = true
break
}
time.Sleep(1 * time.Second)
}
if !finished {
return errors.Errorf("tenant %s locality change still not finished after %d seconds", name, timeoutSeconds)
return errors.Errorf("Tenant %s locality change still not finished after %d seconds", name, timeoutSeconds)
}
return nil
}
Expand Down

0 comments on commit 8453102

Please sign in to comment.