DBInstance v1.1.1 自定义资源定义

规范架构

DBInstanceSpec 定义 DBInstance 的期望状态。

conditions:
- lastTransactionTime: 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
lastBackupTime: string
nextBackupTime: string
observedGeneration: integer
dbcParent:
  name: string
instanceType: string
isStopped: boolean
nodeCount: integer
progressTimeout: string
resources:
  cpu:
  - disks:
    accessModes: string
    annotations: object
    name: string
    selector:
      matchExpressions:
      - key: string
        operator: string
        values: string
        matchLabels: object
    size: string
    storageClass: string
    volumeName: string
  memory: integer or string
schedulingconfig:
  nodeaffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      preference:
        matchExpressions:
        - key: string
          operator: string
          values: string
        matchFields:
        - key: string
          operator: string
          values: string
      weight: integer
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
        matchExpressions:
        - key: string
          operator: string
          values: string
        matchFields:
        - key: string
          operator: string
          values: string
  podAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      podAffinityTerm:
        labelSelector:
          matchExpressions:
          - key: string
            operator: string
            values: string
          matchLabels:
        namespaceSelector:
          matchExpressions:
          - key: string
            operator: string
            values: string
          matchLabels: object
        namespaces: string
        topologyKey: string
      weight: integer
    requiredDuringSchedulingIgnoredDuringExecution:
      labelSelector:
        matchExpressions:
        - key: string
          operator: string
          values: string
        matchLabels: object
      namespaceSelector:
        matchExpressions:
        - key: string
          operator: string
          values: string
        matchLabels: object
      namespaces: string
      topologyKey: string
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      podAffinityTerm:
        labelSelector:
          matchExpressions:
          - key: string
            operator: string
            values: string
          matchLabels:
        namespaceSelector:
          matchExpressions:
          - key: string
            operator: string
            values: string
          matchLabels: object
        namespaces: string
        topologyKey: string
      weight: integer
    requiredDuringSchedulingIgnoredDuringExecution:
      labelSelector:
        matchExpressions:
        - key: string
          operator: string
          values: string
        matchLabels: object
      namespaceSelector:
        matchExpressions:
        - key: string
          operator: string
          values: string
        matchLabels: object
      namespaces: string
      topologyKey: string
  tolerations:
  - effect: string
    key: string
    operator: string
    tolerationSeconds: integer
    value: string

字段

类型
必需或可选

 

说明
dbcParent
object
可选
DBClusterParent 是此 DBInstance 从中复制的 DBCluster。
dbcParent.name
string
可选
引用对象的名称。如需了解详情,请参阅名称
instanceType
string
可选
InstanceType 指示 DBInstance 的类型。目前仅支持“ReadPool”类型。
isStopped
boolean
可选
IsStopped 在设置为 true 时会停止此 DBInstance 中的 DBNode。此字段的默认值为 false。停止 DBCluster 的主 DBNode 不会自动停止 ReadPool DBInstance 的 DBNode。停止后,实例的计算资源(CPU、内存)会被释放。不过,DBNode 仍会保留存储资源。
nodeCount
integer
必需
NodeCount 确定必须为此 DBInstance 创建的 DBNode 数量。
progressTimeout
string
可选
ProgressTimeout 确定控制器在认为 DBNode 失败之前尝试预配 DBNode 的秒数,或 DBNode 可能处于未就绪状态的秒数。值为 0 表示不使用超时。
resources
object
可选
Resource 指定为属于此 DBInstance 的实例(即 DBNode)使用的资源。如果省略,则实例使用与 DBCluster 的主实例相同的资源。
resources.cpu
integer or string
必需
分配给数据库容器的 CPU 数量。
resources.disks
object
必需
分配给数据库容器的磁盘的规范。
resources.disks.accessModes
string
可选
AccessModes 包含卷的所需访问模式。如需了解详情,请参阅访问模式
resources.disks.annotations
object
可选
向永久性卷声明添加的其他注解。这样便可与其他工具集成。
resources.disks.name
string
必需
磁盘的名称。允许的值包括:“DataDisk”“LogDisk”“BackupDisk”和“ObsDisk”。
resources.disks.selector
object
可选
针对考虑进行绑定的卷的标签查询。此字段是可选字段。如果设置了此字段,则系统会将具有匹配标签的卷用作磁盘的支持卷。如需了解详情,请参阅 PersistentVolumeClaimSpec
resources.disks.selector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
resources.disks.selector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
resources.disks.selector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
resources.disks.selector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
resources.disks.selector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
resources.disks.size
string
必需
磁盘大小(以字节为单位),例如“10Gi”表示 10 吉比字节。允许的大小单位前缀包括:适用于 2 进制的“Ki”“Mi”“Gi”“Ti”“Pi”和“Ei”。以及适用于 10 进制的“K”“M”“G”“T”“P”和“E”。如需了解详情,请参阅单位前缀
resources.disks.storageClass
string
可选
StorageClass 指向特定 CSI 存储类别。此字段是可选字段。如果未设置该字段,则系统会使用 Kubernetes 集群的默认 CSI 存储类别。如果 Kubernetes 集群没有默认设置,则永久性卷声明将失败,并且数据库集群将无法预配。有关详情,请参阅存储类别
resources.disks.volumeName
string
可选
VolumeName 是与此磁盘相关联的永久性卷的绑定引用。此字段是可选字段。这样可以重复使用现有卷。请注意,如果指定了此字段,则“storageClass”值将不会生效。如需了解详情,请参阅绑定
resources.memory
integer or string
必需
分配给数据库容器的内存量。
schedulingConfig
object
可选
SchedulingConfig 指定应如何在 Kubernetes 节点上调度实例。如果省略,则实例将使用与 DBCluster 主实例相同的调度配置。调度配置中的任何字段发生更改时,都可能会导致 Kubernetes Pod 基于该配置重新调度到其他节点。
schedulingConfig.nodeAffinity
object
可选
NodeAffinity 描述实例的节点亲和性调度规则。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution
object
可选
调度器会优先将 Pod 调度到满足此字段指定的亲和性表达式的节点。调度器也可能会选择违反一个或多个表达式的节点。最优节点是权重总和最大的节点,换句话说,对于满足所有调度要求(资源请求、requiredDuringScheduling 亲和性表达式等)的每个节点,如果节点与相应的 matchExpressions 匹配,则通过遍历此字段的元素并将“weight”值与总和相加来计算总和;总和最大的节点是最优节点。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference
object
必需
节点选择器相关项,与相应的权重相关联。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions
object
可选
按节点标签列出的节点选择器要求的列表。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.key
string
必需
选择器所应用于的标签键。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.operator
string
必需
表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.values
string
可选
字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。如果运算符为 Gt 或 Lt,则值数组必须包含单个元素,该元素将被解释为整数。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields
object
可选
按节点字段列出的节点选择器要求的列表。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.key
string
必需
选择器所应用于的标签键。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.operator
string
必需
表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.values
string
可选
字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。如果运算符为 Gt 或 Lt,则值数组必须包含单个元素,该元素将被解释为整数。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight
integer
必需
与匹配相应 nodeSelectorTerm 相关联的权重,范围为 1-100。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution
object
可选
如果在调度时不满足此字段指定的亲和性要求,则系统不会将 Pod 调度到相应节点上。如果在 Pod 执行期间的某个时间点未满足此字段指定的亲和性要求(例如由于更新),系统可能会也可能不会尝试最终从其节点中逐出 Pod。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms
object
必需
节点选择器相关项的列表。这些相关项会进行或 (OR) 运算。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions
object
可选
按节点标签列出的节点选择器要求的列表。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.key
string
必需
选择器所应用于的标签键。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.operator
string
必需
表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.values
string
可选
字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。如果运算符为 Gt 或 Lt,则值数组必须包含单个元素,该元素将被解释为整数。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields
object
可选
按节点字段列出的节点选择器要求的列表。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.key
string
必需
选择器所应用于的标签键。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.operator
string
必需
表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.values
string
可选
字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。如果运算符为 Gt 或 Lt,则值数组必须包含单个元素,该元素将被解释为整数。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAffinity
object
可选
PodAffinity 描述实例的 Pod 亲和性调度规则。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution
object
可选
调度器会优先将 Pod 调度到满足此字段指定的亲和性表达式的节点。调度器也可能会选择违反一个或多个表达式的节点。权重总和最大的节点是最优节点。对于满足所有调度要求(资源请求 以及 requiredDuringScheduling 亲和性表达式等)的每个节点,如果节点具有与相应 podAffinityTerm 匹配的 Pod,则通过遍历此字段的元素并将“weight”值与总和相加来计算总和。总和最高的节点是最优节点。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm
object
必需
Pod 亲和性相关项,与相应的权重相关联。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector
object
可选
针对相关项所应用于的一组命名空间的标签查询。相关项会应用于此字段选择的命名空间与 namespaces 字段中列出的命名空间的并集。null 选择器以及 null 或空命名空间列表表示“此 Pod 的命名空间”。空选择器 ({}) 会匹配所有命名空间。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaces
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight
integer
必需
与匹配相应 podAffinityTerm 相关联的权重,范围为 1-100。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution
object
可选
如果在调度时不满足此字段指定的亲和性要求,则系统不会将 Pod 调度到相应节点上。如果在 Pod 执行期间的某个时间点未满足此字段指定的亲和性要求(例如由于 Pod 标签更新),系统可能会也可能不会尝试最终从其节点中逐出 Pod。如果有多个元素,则会使用与每个 podAffinityTerm 对应的节点列表的交集;换句话说,必须满足所有相关项。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector
object
可选
针对相关项所应用于的一组命名空间的标签查询。相关项会应用于此字段选择的命名空间与 namespaces 字段中列出的命名空间的并集。null 选择器以及 null 或空命名空间列表表示“此 Pod 的命名空间”。空选择器 ({}) 会匹配所有命名空间。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
schedulingConfig.podAntiAffinity
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
schedulingConfig.podAntiAffinity
object
可选
PodAntiAffinity 描述实例的 Pod 反亲和性调度规则。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
object
可选
调度器会优先将 Pod 调度到满足此字段指定的反亲和性表达式的节点,但调度器也可能会选择违反一个或多个表达式的节点。最优节点是权重总和最大的节点,换句话说,对于满足所有调度要求(资源请求、requiredDuringScheduling 反亲和性表达式等)的每个节点,如果节点具有与相应 podAffinityTerm 匹配的 Pod,则通过遍历此字段的元素并将“weight”值与总和相加来计算总和。总和最高的节点是最优节点。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm
object
必需
Pod 亲和性相关项,与相应的权重相关联。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector
object
可选
针对相关项所应用于的一组命名空间的标签查询。相关项会应用于此字段选择的命名空间与 namespaces 字段中列出的命名空间的并集。null 选择器以及 null 或空命名空间列表表示“此 Pod 的命名空间”。空选择器 ({}) 会匹配所有命名空间。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchLabels
string
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.topologyKey
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight
integer
必需
与匹配相应 podAffinityTerm 相关联的权重,范围为 1-100。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution
object
可选
如果在调度时不满足此字段指定的反亲和性要求,则系统不会将 Pod 调度到相应节点上。如果在 Pod 执行期间的某个时间点未满足此字段指定的反亲和性要求(例如由于 Pod 标签更新),系统可能会也可能不会尝试最终从其节点中逐出 Pod。如果有多个元素,则会使用与每个 podAffinityTerm 对应的节点列表的交集,这意味着必须满足所有相关项。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector
object
可选
针对相关项所应用于的一组命名空间的标签查询。相关项会应用于此字段选择的命名空间与 namespaces 字段中列出的命名空间的并集。null 选择器以及 null 或空命名空间列表表示“此 Pod 的命名空间”。空选择器 ({}) 会匹配所有命名空间。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行与 (AND) 运算。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.operator
string
必需
operator(运算符)表示键与一组值之间的关系。有效的运算符包括 In、NotIn、Exists 和 DoesNotExist。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行与 (AND) 运算。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
schedulingConfig.tolerations
object
可选
Tolerations 使您可以管理是允许还是禁止在应用了特定污点的 Kubernetes 节点上调度实例。
schedulingConfig.tolerations.effect
string
可选
Effect 指示要匹配的污点效果。空表示匹配所有污点效果。进行指定时,允许的值为 NoSchedule、PreferNoSchedule 和 NoExecute。
schedulingConfig.tolerations.key
string
可选
Key 是容忍所应用于的污点键。空表示匹配所有污点键。如果键为空,运算符必须为 Exists。此组合表示匹配所有值和所有键。
schedulingConfig.tolerations.operator
string
可选
operator(运算符)表示键与值之间的关系。有效的运算符包括 Exists 和 Equal。默认为 Equal。Exists 等效于对值使用通配符,以便 Pod 可以容忍特定类别的所有污点。
schedulingConfig.tolerations.tolerationSeconds
integer
可选
TolerationSeconds 表示容忍(必须为 NoExecute 效果,否则系统会忽略此字段)可容忍污点的时间段。默认情况下,此字段未设置,这表示永久容忍污点(不逐出)。系统会将零值和负值视为 0(立即逐出)。
schedulingConfig.tolerations.value
string
可选
Value 是容忍所匹配的污点值。如果运算符为 Exists,则值必须为空;否则,它只是常规字符串。

状态架构

DBInstanceStatus 定义观察到的 DBInstance 状态。

conditions:
- lastTransitionTime:
  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
endpoints:
- name: string
  value: string
observedGeneration: integer
reconciled: boolean

字段

类型
必需或可选

 

说明
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+数字字符串,例如“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
可选
Cluster 是受影响的 Kubernetes 资源的集群名称。
criticalIncidents.resource.location.group
string
可选
Group 是 Kubernetes 资源的组名称。
criticalIncidents.resource.location.kind
string
可选
kind 是 Kubernetes 资源的种类。
criticalIncidents.resource.location.name
string
可选
Name 是受影响的 Kubernetes 资源的名称。
criticalIncidents.resource.location.namespace
string
可选
Namespace 是受影响的 Kubernetes 资源的命名空间。
criticalIncidents.resource.location.version
string
可选
Version 是 Kubernetes 资源的版本。
criticalIncidents.stackTrace
object
可选
StackTrace 包含来自堆栈轨迹的消息的非结构化列表。
criticalIncidents.stackTrace.component
string
可选
Component 是记录消息的数据库服务组件的名称。
criticalIncidents.stackTrace.message
string
可选
记录的消息。
criticalIncidents.transientUntil
string
可选
如果存在,则 TransientUntil 指示在指定时间之前,问题必须被视为暂时性问题。
endpoints
object
可选
Endpoints 是可从其访问 DBInstance 中的 DBNode 的端点。
endpoints.name
string
必需
Name 包含端点的名称。
endpoints.value
string
可选
Value 包含端点信息。
observedGeneration
integer
可选
控制器观察到的生成。
reconciled
boolean
可选
指示资源是否由控制器进行了协调。