切換至 v1.2.0 自訂資源定義

選取說明文件版本:

規格結構定義

SwitchoverSpec 會定義 Switchover 的所選狀態。

dbclusterRef: string
newPrimary: string
newPrimaryInstance: string
primaryHost: string

欄位

類型
必要或選填

 

說明
dbclusterRef
string
選填
DBClusterRef 是要啟動切換的 DBCluster 名稱。 Switchover 物件必須與參照的 DBCluster 建立在相同的命名空間。這是切換作業的必填欄位。
newPrimary
string
選填
NewPrimary 是待命執行個體,可與目前的主要執行個體切換。
newPrimaryInstance
string
選填
NewPrimaryInstance 是待命執行個體,可與目前的主要執行個體切換。已淘汰:請改用 NewPrimary 欄位。
primaryHost
string
選填
PrimaryHost 是 IP,一律指向主要執行個體。

狀態結構定義

SwitchoverStatus 定義 Switchover 的觀察狀態。

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

欄位

類型
必要或選填

 

說明
conditions
list (object)
選填
「條件」代表實體目前狀態的最新可用觀察結果。
conditions[]
object
選填
Condition 包含這個 API 資源目前狀態某個層面的詳細資料。--- This struct is intended for direct use as an array at the field path .status.conditions. 舉例來說:\n type FooStatus struct{ // Represents the observations of a\n foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }
conditions[].lastTransactionTime
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。值應為 CamelCase 字串。 這個欄位不得留空。
conditions[].status
string
必填

有效值:"True""False"Unknown

條件的狀態,可以是 True、False 或 Unknown。
conditions[].type
string
必填
駝峰式大小寫的條件類型,或 foo.example.com/CamelCase。 --- 許多 .condition.type 值在資源間是一致的,例如 Available,但由於任意條件可能很有用 (請參閱 .node.status.conditions),因此能夠解決衝突非常重要。比對的規則運算式為 (dns1123SubdomainFmt/)?(qualifiedNameFmt)
createTime
string
選填
CreateTime 是指內部切換工作流程機制建立的時間。
criticalIncidents
list (object)
選填
CriticalIncidents 是所有有效 Critical 事件的平面清單。
criticalIncidents[]
object
選填
CriticalIncident 包含持續發生的重大事件的所有資訊。
criticalIncidents[].code
string
必填
Code 是這項特定錯誤的錯誤代碼。 錯誤代碼為 DBSE+數字字串,例如「DBSE1012」。
criticalIncidents[].createTime
string
必填
CreateTime 是指在來源建立這起事件的時間戳記。
criticalIncidents[].message
string
選填
訊息說明發生的事件/錯誤。
criticalIncidents[].messageTemplateParams
object
選填
MessageTemplateParams 包含鍵/值組合,可產生使用者友善的資料驅動型 Message 版本,並顯示在 UI 中。
criticalIncidents[].resource
object
必填
資源包含回報事件的資料庫服務元件,以及 Kubernetes 資源的相關資訊。
criticalIncidents[].resource.component
string
必填
元件是回報事件的資料庫服務子系統內部 ID。
criticalIncidents[].resource.location
object
選填
位置
criticalIncidents[].resource.location.cluster
string
選填
Cluster 是受影響 Kubernetes 資源的叢集名稱。
criticalIncidents[].resource.location.group
string
選填
Group 是 Kubernetes 資源的群組名稱。
criticalIncidents[].resource.location.kind
string
選填
Kind 是 Kubernetes 資源的種類。
criticalIncidents[].resource.location.name
string
選填
名稱是受影響的 Kubernetes 資源名稱。
criticalIncidents[].resource.location.namespace
string
選填
命名空間是受影響 Kubernetes 資源的命名空間。
criticalIncidents[].resource.location.version
TYPE
選填
Group 是 Kubernetes 資源的版本。
criticalIncidents[].stackTrace
list (object)
選填
StackTrace 包含來自堆疊追蹤的非結構化訊息清單。
criticalIncidents[].stackTrace[]
object
選填
CriticalIncidentStackTraceMessage 包含事件的堆疊追蹤資訊。
criticalIncidents[].stackTrace[].component
string
選填
「Component」是記錄訊息的資料庫服務元件名稱。
criticalIncidents[].stackTrace[].message
string
選填
記錄的訊息。
criticalIncidents[].stackTrace[].message
string
選填
如果存在 TransientUntil,表示問題應視為暫時性問題,直到指定時間為止。
endTime
string
選填
EndTime 是指切換作業達到最終狀態的時間。
internal
object
選填
系統控制器會使用 Internal。請勿依賴本節中的資訊。
internal.newPrimary
string
必填
NewPrimary 是我們嘗試切換的執行個體。
internal.oldPrimary
string
必填
OldPrimary 是在切換開始時為主要執行個體的執行個體。
internal.phase
string
選填

有效值:UpdateDbclusterStopPrimaryPromoteStandbyValidateNewPrimaryUpdateOldPrimaryResourcesUpdateNewPrimaryResourcesUpdateOldPrimaryConfigsCompleteSyncOldPrimaryStartOldPrimaryPreSuccessRepointStandbysRollbackPrimaryRollbackStandbys

階段用於追蹤切換作業的目前狀態
observedGeneration
integer
選填
內部:控制器觀察到的世代。
reconciled
boolean
選填
內部:資源是否已由控制器協調。
startTime
string
選填
StartTime 是指切換作業的開始時間。
state
string
選填

有效值:InProgressSuccessFailed_RollbackInProgressFailed_RollbackSuccessFailed_RollbackFailed

狀態是切換作業的目前狀態。 值為 InProgressSuccessFailed_RollbackInProgressFailed_RollbackSuccessFailed_RollbackFailedInProgress 表示切換作業仍在進行中。Success 表示切換作業已完成。Failed_RollbackInProgress 表示運算子無法升級新的主要執行個體,且正在嘗試重新啟動舊的主要執行個體。Failed_RollbackSuccess 表示運算子無法升級新的主要執行個體,但已成功重新啟動舊的主要執行個體。Failed_RollbackFailed 表示運算子無法升級新的主要執行個體,也無法重新啟動舊的主要執行個體。DBCluster 可能需要手動修復。