Skip to content

Commit

Permalink
Fix some problems for 2.1.2 release (oceanbase#156)
Browse files Browse the repository at this point in the history
* fix oceanbase#155, if a server is being deleted, obzone will not count it as a working server
* fix(manifests): modify version of dashboard to 0.1.0; rename image of dashboard to oceanbase-dashboard
* chore(version): update version from 2.1.1 to 2.1.2
  • Loading branch information
powerfooI authored Jan 3, 2024
1 parent dd5cb2a commit 3fef52d
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
platforms: linux/amd64,linux/arm64
file: ./distribution/dashboard/Dockerfile
push: true
tags: ${{ vars.DOCKER_PUSH_BASE }}/dashboard:${{ steps.set_version_vars.outputs.version }}
tags: ${{ vars.DOCKER_PUSH_BASE }}/oceanbase-dashboard:${{ steps.set_version_vars.outputs.version }}
build-args: |
VERSION=${{ steps.set_version_vars.outputs.version }}
COMMIT_HASH=${{ github.sha }}
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.1
VERSION ?= 2.1.2
# 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.1_release/deploy/operator.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/deploy/operator.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.1_r
* 稳定版本

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

* 开发版本
Expand All @@ -44,7 +44,7 @@ Helm Chart 将 ob-operator 部署的命名空间进行了参数化,可在安

```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.1
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.1.2
```

#### 验证部署结果
Expand Down Expand Up @@ -73,7 +73,7 @@ kubectl create secret generic operator-password --from-literal=password='operato
通过以下命令即可在 K8s 集群中部署 OceanBase:

```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.1_release/example/quickstart/obcluster.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_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.1_release/deploy/cert-manager.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_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.1_release/deploy/operator.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/deploy/operator.yaml
```

* Development
Expand All @@ -45,7 +45,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 install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.1.1
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.1.2
```

#### Verify deployment
Expand Down Expand Up @@ -74,7 +74,7 @@ kubectl create secret generic operator-password --from-literal=password='operato
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.1_release/example/quickstart/obcluster.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_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.1
appVersion: 2.1.2
description: A Helm chart for OB-Operator
name: ob-operator
type: application
version: 2.1.1
version: 2.1.2
2 changes: 1 addition & 1 deletion charts/ob-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12629,7 +12629,7 @@ spec:
env:
- name: TELEMETRY_REPORT_HOST
value: https://openwebapi.oceanbase.com
image: oceanbase/ob-operator:2.1.1
image: oceanbase/ob-operator:2.1.2
livenessProbe:
httpGet:
path: /healthz
Expand Down
1 change: 0 additions & 1 deletion charts/oceanbase-cluster/templates/obcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ metadata:
spec:
clusterName: {{ .Values.clusterName | default .Release.Name | quote }}
clusterId: {{ .Values.clusterId | default 1 }}
standalone: {{ .Values.standalone | default false }}
userSecrets:
{{- range $key, $value := .Values.userSecrets }}
{{ $key }}: {{ $value | quote }}
Expand Down
3 changes: 1 addition & 2 deletions charts/oceanbase-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ obAgentVersion: 4.2.1-100000092023101717
annotations:
# "oceanbase.oceanbase.com/independent-pvc-lifecycle": "true"
# "oceanbase.oceanbase.com/single-pvc": "true"

standalone: false
# "oceanbase.oceanbase.com/mode": "standalone"

storageClass: local-path

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.1
newTag: 2.1.2
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12680,7 +12680,7 @@ spec:
- --log-verbosity=0
command:
- /manager
image: oceanbase/ob-operator:2.1.1
image: oceanbase/ob-operator:2.1.2
livenessProbe:
httpGet:
path: /healthz
Expand Down
4 changes: 2 additions & 2 deletions distribution/dashboard/manifests/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
appVersion: "0.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
serviceAccountName: {{ .Release.Name }}-sa
containers:
- name: dashboard
image: oceanbasedev/oceanbase-dashboard:0.1.0
image: oceanbase/oceanbase-dashboard:{{ .Chart.AppVersion }}
resources:
requests:
cpu: 100m
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.1
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.1.2
```

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.1`.
* version: ob-operator version number. It is recommended to use the latest version `2.1.2`.

## 2.2 Deploying with Configuration Files

* Stable
```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.1_release/deploy/operator.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_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.1
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.1.2
```

参数说明:

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

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

## 2.2 使用配置文件部署

* Stable
```shell
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.1_release/deploy/operator.yaml
kubectl apply -f https://raw.githubusercontent.com/oceanbase/ob-operator/2.1.2_release/deploy/operator.yaml
```
* Development
```shell
Expand Down
2 changes: 2 additions & 0 deletions example/obcluster/obcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
namespace: oceanbase
# annotations:
# "oceanbase.oceanbase.com/independent-pvc-lifecycle": "true"
# "oceanbase.oceanbase.com/single-pvc": "true"
# "oceanbase.oceanbase.com/mode": "standalone"
spec:
clusterName: obcluster
clusterId: 1
Expand Down
4 changes: 4 additions & 0 deletions internal/resource/obzone/obzone_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package obzone

import (
zonestatus "github.com/oceanbase/ob-operator/internal/const/status/obzone"
"github.com/oceanbase/ob-operator/pkg/task/const/strategy"
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

Expand Down Expand Up @@ -63,6 +64,9 @@ func DeleteOBServer() *tasktypes.TaskFlow {
Name: fDeleteOBServer,
Tasks: []tasktypes.TaskName{tDeleteOBServer, tWaitReplicaMatch},
TargetStatus: zonestatus.Running,
OnFailure: tasktypes.FailureRule{
Strategy: strategy.RetryFromCurrent,
},
},
}
}
Expand Down
4 changes: 4 additions & 0 deletions internal/resource/obzone/obzone_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ func (m *OBZoneManager) DeleteOBServer() tasktypes.TaskError {
}
observerCount := 0
for _, observer := range observerList.Items {
// bugfix: if an observer is being deleted, it won't be deleted again or counted as a working observer
if observer.Status.Status == serverstatus.Deleting {
continue
}
if observer.Status.Status == serverstatus.Unrecoverable || observerCount >= m.OBZone.Spec.Topology.Replica {
m.Logger.Info("delete observer", "observer", observer)
err = m.Client.Delete(m.Ctx, &observer)
Expand Down

0 comments on commit 3fef52d

Please sign in to comment.