-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
172 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
141 changes: 141 additions & 0 deletions
141
config/crd/bases/apps.leqiutong.xyz_databaseinstances.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.16.1 | ||
name: databaseinstances.apps.leqiutong.xyz | ||
spec: | ||
group: apps.leqiutong.xyz | ||
names: | ||
kind: DatabaseInstance | ||
listKind: DatabaseInstanceList | ||
plural: databaseinstances | ||
singular: databaseinstance | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
description: DatabaseInstance 是 databaseinstances API 的 Schema | ||
properties: | ||
apiVersion: | ||
description: |- | ||
APIVersion defines the versioned schema of this representation of an object. | ||
Servers should convert recognized schemas to the latest internal value, and | ||
may reject unrecognized values. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
type: string | ||
kind: | ||
description: |- | ||
Kind is a string value representing the REST resource this object represents. | ||
Servers may infer this from the endpoint the client submits requests to. | ||
Cannot be updated. | ||
In CamelCase. | ||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: Spec 定义了 DatabaseInstance 的期望状态 | ||
properties: | ||
backupPolicy: | ||
description: BackupPolicy 定义了备份策略配置 | ||
properties: | ||
backupImage: | ||
description: BackupImage 定义备份容器使用的镜像 | ||
type: string | ||
enabled: | ||
description: Enabled 指示是否启用备份 | ||
type: boolean | ||
retention: | ||
description: Retention 定义备份的保留策略 | ||
type: string | ||
schedule: | ||
description: Schedule 定义备份的计划 | ||
type: string | ||
type: object | ||
databaseType: | ||
description: DatabaseType 表示数据库的类型(目前支持 mysql、postgres、oceanbase-ce | ||
这 3 种) | ||
type: string | ||
image: | ||
description: Image 表示数据库的容器镜像,包括版本/标签 | ||
type: string | ||
replicas: | ||
description: Replicas 表示数据库副本的数量 | ||
format: int32 | ||
type: integer | ||
resources: | ||
description: Resources 定义了数据库的资源请求和限制 | ||
properties: | ||
requests: | ||
description: Requests 定义了内存和 CPU 的资源请求 | ||
properties: | ||
cpu: | ||
description: CPU 表示 CPU 请求 | ||
type: string | ||
memory: | ||
description: Memory 表示内存请求 | ||
type: string | ||
type: object | ||
type: object | ||
storage: | ||
description: Storage 表示数据库的存储容量 | ||
type: string | ||
version: | ||
description: Version 表示数据库的版本 | ||
type: string | ||
type: object | ||
status: | ||
description: Status 定义了 DatabaseInstance 资源的观察到的状态 | ||
properties: | ||
conditions: | ||
description: Conditions 记录数据库实例的条件或状态 | ||
items: | ||
description: DatabaseInstanceCondition 表示数据库实例的特定方面的状态 | ||
properties: | ||
lastTransitionTime: | ||
description: LastTransitionTime 是条件从一个状态过渡到另一个状态的最后时间 | ||
format: date-time | ||
type: string | ||
message: | ||
description: Message 表示相关条件的详细信息 | ||
type: string | ||
reason: | ||
description: Reason 表示条件最后一次过渡的原因 | ||
type: string | ||
status: | ||
description: Status 条件的状态(例如:True、False) | ||
type: string | ||
type: | ||
description: Type 条件的类型(例如:Ready、Available) | ||
type: string | ||
required: | ||
- lastTransitionTime | ||
- message | ||
- reason | ||
- status | ||
- type | ||
type: object | ||
type: array | ||
lastUpdated: | ||
description: LastUpdated 是状态最后一次更新的时间戳 | ||
format: date-time | ||
type: string | ||
message: | ||
description: Message 表示相关状态的附加信息或错误消息 | ||
type: string | ||
phase: | ||
description: Phase 表示数据库实例当前所处的阶段(例如:Pending、Running、Failed) | ||
type: string | ||
readyReplicas: | ||
description: ReadyReplicas 表示当前已就绪的副本数量 | ||
format: int32 | ||
type: integer | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
apiVersion: apps.zwjk.com/v1 | ||
apiVersion: apps.leqiutong.xyz/v1 | ||
kind: DatabaseInstance | ||
metadata: | ||
labels: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module git.ucmed.cn/pdd/k8s-database-operator | ||
module github.com/cmjzzx/k8s-database-operator | ||
|
||
go 1.22.0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters