规范架构
ReplicationSpec 定义复制的期望状态。
dbcluster:
  name: string
downstream:
  control: string
  host: string
  password:
    name: string
    namespace: string
  port: integer
  replicationSlotName: string
  username: string
upstream:
  applicationName: string
  logicalReplication:
    databaseName: string
    pluginName: string
  password:
    name: string
    namespace: string
  replicationSlotName: string
  synchronous: string
  username: string
| 字段类型 必需或可选 | 说明 | 
|---|---|
| dbcluster | |
| object可选 | DBCluster 是此复制所属的 DBCluster。 | 
| dbcluster.name | |
| string可选 | 引用对象的名称。如需了解详情,请参阅名称。 | 
| downstream | |
| object可选 | Downstream 包含有关复制下游数据库的规范。 | 
| downstream.control | |
| string必需 | Control 指定要对此数据库执行的复制操作。允许的值包括 setup、promote 和 rewind。 | 
| downstream.host | |
| string必需 | Host 是此数据库可以访问以进行复制的上游数据库连接端点。 | 
| downstream.password | |
| object必需 | Password 是对存储上游数据库复制用户密码的 Secret 的引用。 | 
| downstream.password.name | |
| string可选 | name 在命名空间中是唯一的,用于引用 Secret 资源。 | 
| downstream.password.namespace | |
| string可选 | namespace 定义 Secret 名称必须在其中具有唯一性的空间。 | 
| downstream.port | |
| integer可选 | Port 是此数据库可以访问以进行复制的上游数据库端口。默认值为 5432。 | 
| downstream.replicationslotname | |
| string必需 | ReplicationSlotName 是在上游数据库中创建的复制槽的名称。此数据库会使用它进行复制。 | 
| downstream.username | |
| string必需 | Username 是在上游数据库中创建的复制用户的名称。此数据库会使用它连接到上游以进行复制。 | 
| upstream | |
| object可选 | Upstream 包含有关复制上游数据库的规范。 | 
| upstream.applicationName | |
| string可选 | applicationName 是同步复制连接的标识符。如果 Synchronous 设置为 true,则此值是必需的。 | 
| upstream.logicalReplication | |
| object可选 | LogicalReplication 指定复制槽的逻辑复制配置。如果为空,则复制槽会配置为物理复制槽。 | 
| upstream.logicalReplication.databaseName | |
| string可选 | DatabaseName 是与此槽关联的数据库。只有来自此数据库的更改才会通过该槽进行流式传输。 | 
| upstream.logicalReplication.pluginName | |
| string可选 | PluginName 是与此槽关联的解码插件。如需了解详情,请参阅逻辑解码说明。 | 
| upstream.password | |
| object必需 | Password 是对存储复制用户密码的 Secret 的引用。如果未提供 Password,系统会生成密码并将其存储在一个 Secret 中(在状态中显示)。 | 
| upstream.password.name | |
| string可选 | name 在命名空间中是唯一的,用于引用 Secret 资源。 | 
| upstream.password.namespace | |
| string可选 | namespace 定义 Secret 名称必须在其中具有唯一性的空间。 | 
| upstream.replicationslotname | |
| string可选 | ReplicationSlotName 是要用于复制的复制槽的名称。如果未提供,系统会生成复制槽名称并显示在状态中。 | 
| upstream.synchronous | |
| string可选 | Synchronous 指定复制槽是否必须配置为进行同步复制。如果为 true,则 applicationName 会添加到同步备用实例列表中。此值默认为 false。注意:这可能会对性能产生负面影响。 | 
| upstream.username | |
| string可选 | Username 是要用于复制的复制用户的名称。如果未提供,系统会生成用户名并显示在状态中。 | 
状态架构
ReplicationStatus 定义观察到的复制状态。
conditions:
- lastTransitionTime: string
  message: string
  observedGeneration: integer
  reason: string
  status: string
  type: string
criticalIncidents:
- code: string
  createTime: string
  message: string
  messageTemplateParams: object
  resource:
    component: string
    location:
      cluster: string
      group: string
      kind: string
      name: string
      namespace: string
      version: string
  stackTrace:
  - component: string
    message: string
  transientUntil: string
downstream:
  physicalDownstream:
    passwordResourceVersion: string
    setupStrategies:
      endedAt: string
      message: string
      retries: integer
      startedAt: string
      state: string
      strategy: string
    state: string
observedGeneration: integer
reconciled: boolean
upstream:
  host: string
  password:
    name: string
    namespace: string
  port: integer
  replicationSlotName: string
  username: 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)。 | 
| 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 指示在指定时间之前,问题必须被视为暂时性问题。 | 
| downstream | |
| object可选 | Downstream 包含观察到的复制下游数据库状态。 | 
| downstream.physicalDownstream | |
| object可选 | |
| downstream.physicalDownstream.passwordResourceVersion | |
| string可选 | PasswordResourceVersion 是 Secret 密码的资源版本。此版本表示密码上次在数据库中更新的时间。 | 
| downstream.physicalDownstream.setupStrategies | |
| object可选 | SetupStrategies 包含有关尝试的每个设置策略的执行信息。它们在此列表中显示的顺序与规范中定义策略的顺序相同。 | 
| downstream.physicalDownstream.setupStrategies.endedAt | |
| string可选 | EndedAt 是此策略最近一次尝试结束的时间。 | 
| downstream.physicalDownstream.setupStrategies.message | |
| string可选 | Message 是关于设置尝试处于当前状态的原因的说明。 | 
| downstream.physicalDownstream.setupStrategies.retries | |
| integer可选 | Retries 是此策略已重试的次数。 | 
| downstream.physicalDownstream.setupStrategies.startedAt | |
| string可选 | StartedAt 是此策略最近一次尝试开始的时间。 | 
| downstream.physicalDownstream.setupStrategies.state | |
| string必需 | State 是此设置策略的当前状态。它接受以下值: InProgress:策略当前正在执行。Success:策略已成功完成,系统不会再尝试其他设置策略。Error:策略失败,但将重试。Retries 字段显示此策略已重试的次数。Fallback:策略失败,且不会重试。而是会回退到下一个可用的策略(如果存在)。Unknown | 
| downstream.physicalDownstream.setupStrategies.strategy | |
| string必需 | Strategy 是此状态所对应的策略类型的名称。 | 
| downstream.physicalDownstream.state | |
| object可选 | State 是复制状态,可在下游数据库服务器的 pg_stat_wal_receiver 表中看到。 | 
| observedgeneration | |
| integer可选 | 内部:控制器观察到的生成。 | 
| reconciled | |
| boolean可选 | 内部:资源是否由控制器进行了协调。 | 
| upstream | |
| object可选 | Upstream 包含观察到的复制上游数据库状态。 | 
| upstream.host | |
| string可选 | Host 是下游数据库可以访问以进行复制的数据库连接端点。 | 
| upstream.password | |
| object可选 | Password 是对存储此数据库复制用户密码的 Secret 的引用。 | 
| upstream.password.name | |
| string可选 | name 在命名空间中是唯一的,用于引用 Secret 资源。 | 
| upstream.password.namespace | |
| string可选 | namespace 定义 Secret 名称必须在其中具有唯一性的空间。 | 
| upstream.port | |
| integer可选 | Port 是下游数据库可以访问以进行复制的此数据库端口。 | 
| upstream.replicationslotname | |
| string可选 | ReplicationSlotName 是在此数据库中创建的复制槽的名称。下游数据库可以使用此复制槽进行复制。 | 
| upstream.username | |
| string可选 | Username 是此数据库中的复制用户的名称。下游数据库可以使用此用户连接到此数据库以进行复制。 |