故障切换 v1.5.0 自定义资源定义

选择文档版本:

规范架构

FailoverSpec 表示单个故障切换操作的参数。

dbclusterRef: string
newPrimary: string

字段

类型
必需或可选

 

说明
dbclusterRef
string
必需
DBClusterRef 是用于启动故障切换的 DBCluster 名称。故障切换对象必须在它引用的 DBCluster 所在的命名空间中创建。
newPrimary
string
可选
NewPrimary 是要提升为新的主实例的备用实例。如果留空,系统会自动选择要故障切换到的最佳实例。

状态架构

FailoverStatus 表示故障切换的当前状态。

conditions:
- lastTransitionTime: string
  message: string
  observedGeneration: integer
  reason: string
  status: string
  type: string
createTime: string
criticalIncidents:
- code: string
  createTime: string
  message: string
  messageTemplateParams: object
  resource:
    component: string
    location:
      cluster: string
      kind: string
      name: string
      namespace: string
      version: string
  stackTrace:
  - component: string
    message: string
  transientUntil: string
endTime: string
internal:
  attempt: integer
  lastPhaseChangeTime: string
  newPrimary: string
  newPrimaryZone: string
  oldPrimary: string
  phase: string
observedGeneration: integer
reconciled: boolean
startTime: string
state: string

字段

类型
必需或可选

 

说明
conditions[]
object
可选
Conditions 表示实体当前状态的最新可用观察结果。
conditions[].lastTransitionTime
string
必需
lastTransitionTime 是条件上次从一种状态转换到另一种状态的时间,这在底层条件更改时发生。如果底层条件更改的时间未知,则使用 API 字段更改的时间。
conditions[].message
string
必需
message 是人类可读的消息,指示有关转换的详细信息。此字段可以为空字符串。
conditions[].observedGeneration
integer
可选
observedGeneration 表示设置条件所基于的 .metadata.generation。例如,如果 .metadata.generation 为 12,但 .status.conditions[x].observedGeneration 为 9,则表示条件相对于实例的当前状态已过时。
conditions[].reason
string
必需
reason 包含一个程序化标识符,指示条件上次转换的原因。特定条件类型的生成者可以为此字段定义预期值和含义,以及这些值是否被视为有保证的 API。值必须是 CamelCase 字符串。此字段不得为空。
conditions[].status
string
必需
条件的状态,为 True、False、Unknown 之一。
conditions[].type
string
必需
条件的类型,采用 CamelCase 或 foo.example.com/CamelCase 形式。许多 .condition.type 值(例如 Available)在各个资源中是一致的。由于任意条件都可能会有用(例如 .node.status.conditions),因此能够解决冲突非常重要。它匹配的正则表达式为 (dns1123SubdomainFmt/)?(qualifiedNameFmt)。
createTime
string
可选
CreateTime 是创建内部故障切换工作流机制的时间。
criticalIncidents[]
object
必需
CriticalIncidents 是所有活跃的严重突发事件的扁平列表。
criticalIncidents[].code
string
必需
Code 是此特定错误的错误代码。错误代码是 DBSE+numeric 字符串,例如 DBSE1012
criticalIncidents[].createTime
string
必需
CreateTime 是在源头创建此突发事件时的时间戳。
criticalIncidents[].message
string
可选
Message 描述发生的突发事件或错误。
criticalIncidents[].messageTemplateParams
object
可选
MessageTemplateParams 包含在界面中生成人性化数据驱动型消息版本所需的键值对。
criticalIncidents[].resource
object
必需
Resource 包含有关报告突发事件的数据库服务组件的信息,以及有关 Kubernetes 资源的信息。
criticalIncidents[].resource.component
string
必需
Component 是报告突发事件的数据库服务子系统的内部标识符。
criticalIncidents[].resource.location
object
可选
位置。
criticalIncidents[].resource.location.cluster
string
可选
受影响的 Kubernetes 资源的集群名称。
criticalIncidents[].resource.location.group
string
可选
Kubernetes 资源的组名称。
criticalIncidents[].resource.location.kind
string
可选
Kubernetes 资源的种类。
criticalIncidents[].resource.location.name
string
可选
受影响的 Kubernetes 资源的名称。
criticalIncidents[].resource.location.namespace
string
可选
受影响的 Kubernetes 资源的命名空间。
criticalIncidents[].resource.location.version
string
可选
Kubernetes 资源的版本。
criticalIncidents[].stackTrace[]
object
可选
来自堆栈轨迹的消息的非结构化列表。
criticalIncidents[].stackTrace[].component
string
可选
记录消息的数据库服务组件的名称。
criticalIncidents[].stackTrace.message
string
可选
记录的消息。
criticalIncidents[].transientUntil
string
可选
如果存在,则 TransientUntil 指示在指定时间之前,问题必须被视为暂时性问题。
endTime
string
可选
EndTime 是故障切换达到最终状态的时间。
internal
object
可选
Internal 由系统控制器使用。请勿依赖此部分中的信息。
internal.attempt
integer
必需
Attempt 用于重试逻辑。
internal.lastPhaseChangeTime
string
可选
LastPhaseChangeTime 是 L1 故障切换上次更改为新阶段的时间。这用于超时逻辑。
internal.newPrimary
string
必需
NewPrimary 是您尝试故障切换到的实例。
internal.newPrimaryZone
string
可选
NewPrimaryZone 是我们尝试故障切换到的可用区。
internal.oldPrimary
string
必需
OldPrimary 是故障切换开始时的主实例。
internal.phase
string
可选
Phase 用于跟踪故障切换的当前状态。
observedGeneration
integer
可选
内部:控制器观察到的生成。
reconciled
boolean
可选
内部:资源是否由控制器进行了协调。
startTime
string
可选
StartTime 是故障切换操作开始的时间。
state
string
可选
State 是故障切换操作的当前状态。值包括 InProgress、Success、Failed_RollbackInProgress、Failed_RollbackSuccess 和 Failed_RollbackFailed。
  • InProgress 表示故障切换仍在进行中。
  • Success 表示故障切换已完成。成功提升了新的主实例后,故障切换便完成。
  • Failed_RollbackInProgress 表示操作器无法提升新的主实例,并且正在尝试重启旧的主实例。
  • Failed_RollbackSuccess 表示操作器无法提升新的主实例,并且已成功重启旧的主实例。
  • Failed_RollbackFailed 表示操作器无法提升新的主实例,并且无法重启旧的主实例。可能需要手动修复 DBCluster。