複製作業 v1.3.0 自訂資源定義

規格結構定義

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 是這個 Replication 所屬的 DBCluster。
dbcluster.name
string
選填
參照對象的名稱。詳情請參閱「名稱」。
downstream
object
選填
Downstream 包含複製下游資料庫的規格。
downstream.control
string
必填
控制項會指定要對這個資料庫執行的複製作業。允許的值為 setup、promote 和 rewind。
downstream.host
string
必填
主機是上游資料庫的連線端點,這個資料庫可以存取該端點來進行複製。
downstream.password
object
必填
密碼是指儲存上游資料庫複製使用者密碼的密鑰。
downstream.password.name
string
選填
名稱在命名空間內不得重複,用於參照密鑰資源。
downstream.password.namespace
string
選填
namespace 定義了 Secret 名稱不得重複的空間。
downstream.port
integer
選填
通訊埠是指上游資料庫的通訊埠,這個資料庫可以存取該通訊埠來執行複製作業。預設值為 5432。
downstream.replicationslotname
string
必填
ReplicationSlotName 是在上游資料庫建立的複製運算單元名稱。這個資料庫會使用這個值進行複製。
downstream.username
string
必填
使用者名稱是指在上游資料庫建立的複製使用者名稱。這個資料庫會使用該金鑰連線至上游,以便進行複製。
upstream
object
選填
Upstream 包含複製上游資料庫的規格。
upstream.applicationName
string
選填
applicationName 是同步複製連線的 ID。如果 Synchronous 設為「true」,則必須提供這個值。
upstream.logicalReplication
object
選填
LogicalReplication 會指定複製運算單元的邏輯複製設定。如果留空,複製運算單元會設為實體複製運算單元。
upstream.logicalReplication.databaseName
string
選填
DatabaseName 是與這個運算單元相關聯的資料庫。只有這個資料庫的變更會透過運算單元串流。
upstream.logicalReplication.pluginName
string
選填
PluginName 是與這個版位相關聯的解碼外掛程式。詳情請參閱邏輯解碼說明。
upstream.password
object
必填
密碼是指儲存複製使用者密碼的密鑰。 如未提供密碼,系統會產生密碼,並儲存在狀態中顯示的密鑰。
upstream.password.name
string
選填
名稱在命名空間內不得重複,用於參照密鑰資源。
upstream.password.namespace
string
選填
namespace 定義了 Secret 名稱不得重複的空間。
upstream.replicationslotname
string
選填
ReplicationSlotName 是要用於複製作業的複製運算單元名稱。如未提供,系統會產生複製運算單元名稱,並顯示在狀態中。
upstream.synchronous
string
選填
「同步」會指定是否必須為同步複製設定複製槽。如果為 true,applicationName 會新增至同步待命清單。預設值為 false。
注意:這可能會對效能造成負面影響。
upstream.username
string
選填
使用者名稱是指用於複製作業的複製使用者名稱。 如未提供,系統會產生使用者名稱,並顯示在狀態中。

狀態結構定義

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:
    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[].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 包含程式輔助 ID,指出條件上次轉換的原因。特定條件類型的產生者可以定義這個欄位的預期值和意義,以及這些值是否視為保證 API。值必須是駝峰式大小寫字串。 這個欄位不得留空。
conditions[].status
string
必填
條件狀態,可為 True、False 或 Unknown。
conditions[].type
string
必填
條件類型,採用駝峰式大小寫或 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
選填
訊息會說明發生的事件或錯誤。
criticalIncidents[].messageTemplateParams
object
選填
MessageTemplateParams 包含鍵/值組合,用於在使用者介面中產生容易使用的資料導向訊息版本。
criticalIncidents[].resource
object
必填
資源包含回報事件的資料庫服務元件相關資訊,以及 Kubernetes 資源的相關資訊。
criticalIncidents[].resource.component
string
必填
元件是回報事件的資料庫服務子系統內部 ID。
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.setupStrategies
object
選填
SetupStrategies 包含每次嘗試設定策略的執行資訊。清單中的顯示順序與規格中定義的策略順序相同。
downstream.physicalDownstream.setupStrategies.endedAt
string
選填
EndedAt 是這項策略最近一次嘗試結束的時間。
downstream.physicalDownstream.setupStrategies.message
string
選填
訊息會說明設定嘗試處於目前狀態的原因。
downstream.physicalDownstream.setupStrategies.retries
integer
選填
「重試」是指這項策略的重試次數。
downstream.physicalDownstream.setupStrategies.startedAt
string
選填
StartedAt 是指最近一次嘗試這項策略的時間。
downstream.physicalDownstream.setupStrategies.state
string
必填
狀態是指這項設定策略的目前狀態。可接受的值如下:
InProgress:策略目前正在執行。
Success:策略已成功完成,不會再嘗試其他設定策略。
Error:策略失敗,但會重試。「重試」欄位會顯示這項策略的重試次數。
Fallback:策略失敗,不會重新嘗試。而是會改用下一個可用的策略 (如有)。
Unknown
downstream.physicalDownstream.setupStrategies.strategy
string
必填
「策略」是指這個狀態適用的策略類型名稱。
downstream.physicalDownstream.state
object
選填
「狀態」是指下游資料庫伺服器 pg_stat_wal_receiver 資料表中的複製狀態。
observedgeneration
integer
選填
內部:控制器觀察到的世代。
reconciled
boolean
選填
內部:資源是否已由控制器協調。
upstream
object
選填
Upstream 包含複製上游資料庫的觀測狀態。
upstream.host
string
選填
主機是這個資料庫的連線端點,下游資料庫可存取這個端點來執行複製作業。
upstream.password
object
選填
密碼是指儲存這個資料庫複製使用者密碼的密鑰。
upstream.password.name
string
選填
名稱在命名空間內不得重複,用於參照密鑰資源。
upstream.password.namespace
string
選填
namespace 定義了 Secret 名稱不得重複的空間。
upstream.port
integer
選填
通訊埠是這個資料庫的通訊埠,下游資料庫可以存取這個通訊埠來複製資料。
upstream.replicationslotname
string
選填
ReplicationSlotName 是在這個資料庫上建立的複製運算單元名稱。下游資料庫可以使用這個複製運算單元進行複製。
upstream.username
string
選填
使用者名稱是這個資料庫的複製使用者名稱。下游資料庫可以使用這個使用者連線至這個資料庫,以便進行複製。