PgBouncer v1.3.0 自定义资源定义

选择文档版本:

规范架构

PgBouncerSpec 定义 PgBouncer 的所选状态。

accessMode: string
allowSuperUserAccess: boolean
dbclusterRef: string
parameters: object
podSpec:
  image: string
  resources:
    cpu: integer or 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: object
          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
              type: string
            matchLabels: object
          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
            type: string
          matchLabels: object
        namespaces: string
        topologyKey: string
    tolerations:
    - effect: string
      key: string
      operator: string
      tolerationSeconds: integer
      value: string
replicaCount: integer
serverTLS:
  certSecret:
    name: string
serviceOptions:
  annotations: object
  gcp:
    loadBalancerIP: string
    loadBalancerType: string
  type: object

字段

类型
必需或可选

 

说明
accessMode
string
可选
为 PgBouncer 连接定义 read-writeread-only 访问模式。默认值为 read-only
allowSuperUserAccess
boolean
可选
AllowSuperUserAccess 可设置为 true 或 false
dbclusterRef
string
必需
DBClusterRef 是 PgBouncer 为其管理连接池的 DBCluster 名称。您必须在引用的 DBCluster 所在的命名空间中创建 PgBouncer 对象。此字段是 PgBouncer 连接池的必需字段。
parameters
object
可选
Parameters 包含可设置的各种 PgBouncer 配置的键值对。如需了解可用的各种选项,请参阅 https://www.pgbouncer.org/config.html创建 PgBouncer 服务提供了一些使用此规范的示例。
podspec
object
必需
PodSpec 包含 PgBouncer Pod 的规范。其中包含为 PgBouncer Pod 提供服务的映像、计算和存储资源,以及调度选项。
podSpec.image
string
必需
Image 是 Artifact Registry 中自定义 pgbouncer 映像的统一资源标识符。
podSpec.resources
object
必需
Resources 表示内存和 CPU 的当前配置。
podSpec.resources.cpu
integer or string
必需
分配给 pgbouncer 容器的 CPU 容量。
podSpec.resources.memory
integer or string
必需
分配给 PgBouncer 容器的内存量。
podSpec.schedulingConfig
object
可选
使用 SchedulingConfig 字段可指定如何在 Kubernetes 节点上调度实例。更改调度配置中的任何字段可能会导致 Kubernetes 将 Pod 重新调度到其他节点上,具体取决于新配置。
podSpec.schedulingConfig.nodeAffinity
object
可选
NodeAffinity 描述实例的节点亲和性调度规则。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution
object
可选
借助此字段,您可以指定调度 Pod 的亲和性偏好设置。调度器会尝试将 Pod 放置在符合您偏好设置的节点上。不过,并非总是可以这样。调度器会根据每个节点与您的偏好设置的匹配程度来计算其“权重”,并选择权重最高的节点。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference
object
必需
节点选择器相关项,与相应的权重相关联。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions
object
可选
按节点标签列出的节点选择器要求的列表。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.key
string
必需
选择器所应用于的标签键。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.operator
string
必需
表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExistGtLt
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.values
string
可选
字符串值的数组。如果运算符为 InNotIn,则值数组不得为空。如果运算符为 ExistsDoesNotExist,则值数组必须为空。如果运算符为 GtLt,则值数组必须包含单个元素,该元素将被解释为整数。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields
object
可选
按节点字段列出的节点选择器要求的列表。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.key
string
必需
选择器所应用于的标签键。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.operator
string
必需
表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExistGtLt
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.values
string
可选
字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。如果运算符为 Gt 或 Lt,则值数组必须包含单个元素,该元素将被解释为整数。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight
integer
必需
与匹配相应 nodeSelectorTerm 相关联的权重介于 1 到 100(包含 1 和 100)之间。
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution
object
可选
如果未满足此字段的亲和性要求,调度器不会将 Pod 调度到节点上。如果在 Pod 执行期间的某个时间点未满足此字段指定的亲和性要求(例如由于更新),系统可能会也可能不会尝试最终从其节点中逐出 Pod。
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms
object
必需
节点选择器相关项的列表。这些相关项会进行 OR 运算。
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions
object
可选
按节点标签列出的节点选择器要求的列表。
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.key
string
必需
选择器所应用于的标签键。
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.operator
string
必需
表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExistGtLt
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions.values
string
可选
字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。如果运算符为 Gt 或 Lt,则值数组必须包含单个元素,该元素将被解释为整数。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields
object
可选
按节点字段列出的节点选择器要求的列表。
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.key
string
必需
选择器所应用于的标签键。
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.operator
string
必需
表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExistGtLt
podSpec.schedulingConfig.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchFields.values
string
可选
字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。如果运算符为 Gt 或 Lt,则值数组必须包含单个元素,该元素将被解释为整数。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAffinity
object
可选
PodAffinity 描述实例的 Pod 亲和性调度规则。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution
object
可选
调度器在调度 Pod 时,会优先考虑满足此字段中指定的亲和性表达式的节点。调度器仍可能会选择不完全符合条件的节点。最优节点是总权重最高的节点。此权重的计算方式是将满足所有调度要求(例如资源请求或 requiredDuringScheduling 亲和性表达式)的每个节点的值相加。对于每个匹配的 podAffinityTerm,节点的权重都会增加,并且总权重最高的节点会被选为最优节点。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm
object
必需
Pod 亲和性相关项,与相应的权重相关联。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions
object
可选
列表中的所有 matchExpressions 都必须为 true,才会实现匹配。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.key
string
必需
选择器所应用于的标签键。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.operator
string
必需
operator 表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExist
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector
object
可选
针对相关项所应用于的一组命名空间的标签查询。相关项会应用于此字段选择的命名空间与 namespaces 字段中列出的命名空间的并集。null 选择器以及 null 或空命名空间列表表示“此 Pod 的命名空间”。空选择器 ({}) 会匹配所有命名空间。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.operator
string
必需
operator 表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExist
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.topologyKey
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
podSpec.schedulingConfig.podAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight
integer
必需
与匹配相应 podAffinityTerm 相关联的权重,范围为 1-100。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution
object
可选
如果在调度时不满足此字段指定的亲和性要求,则系统不会将 Pod 调度到相应节点上。如果在 Pod 执行期间的某个时间点未满足此字段指定的亲和性要求(例如由于 Pod 标签更新),系统可能会也可能不会尝试最终从其节点中逐出 Pod。如果有多个元素,则会使用与每个 podAffinityTerm 对应的节点列表的交集,这意味着必须满足所有相关项。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions
object
可选
列表中的所有 matchExpressions 都必须为 true,才会实现匹配。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.operator
string
必需
operator 表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExist
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector
object
可选
针对相关项所应用于的一组命名空间的标签查询。相关项会应用于此字段选择的命名空间与 namespaces 字段中列出的命名空间的并集。null 选择器以及 null 或空命名空间列表表示“此 Pod 的命名空间”。空选择器 ({}) 会匹配所有命名空间。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.operator
string
必需
operator 表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExistGtLt
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
podSpec.schedulingConfig.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
podSpec.schedulingConfig.podAntiAffinity
object
可选
PodAntiAffinity 描述实例的 Pod 反亲和性调度规则。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
object
可选
调度器会优先将 Pod 调度到满足此字段指定的反亲和性表达式的节点,但调度器也可能会选择违反一个或多个表达式的节点。最优节点是权重总和最大的节点,换句话说,对于满足所有调度要求(资源请求、requiredDuringScheduling 反亲和性表达式等)的每个节点,如果节点具有与相应 podAffinityTerm 匹配的 Pod,则通过遍历此字段的元素并将“权重”值与总和相加来计算总和。总和最高的节点是最优节点。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm
object
必需
Pod 亲和性相关项,与相应的权重相关联。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.operator
string
必需
operator 表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExist
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector
object
可选
针对相关项所应用于的一组命名空间的标签查询。相关项会应用于此字段选择的命名空间与 namespaces 字段中列出的命名空间的并集。null 选择器以及 null 或空命名空间列表表示“此 Pod 的命名空间”。空选择器 ({}) 会匹配所有命名空间。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.operator
string
必需
operator 表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExist
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaceSelector.matchLabels
object
可选
键值对的映射。每个键值对都作为一项要求。调度器会将 Pod 与具有 matchLabels 中指定的所有标签的节点进行匹配。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.topologyKey
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
podSpec.schedulingConfig.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight
integer
必需
与匹配相应 podAffinityTerm 相关联的权重,范围为 1-100。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution
object
可选
如果在调度时不满足此字段指定的反亲和性要求,则系统不会将 Pod 调度到相应节点上。如果在 Pod 执行期间的某个时间点不再满足此字段指定的反亲和性要求(例如由于 Pod 标签更新),系统可能会也可能不会尝试最终从其节点中逐出 Pod。如果有多个元素,则会使用与每个 podAffinityTerm 对应的节点列表的交集,这意味着必须满足所有相关项。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector
object
可选
针对一组资源(在本例中为 Pod)的标签查询。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.operator
string
必需
operator 表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExist
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.labelSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector
object
可选
针对相关项所应用于的一组命名空间的标签查询。相关项会应用于此字段选择的命名空间与 namespaces 字段中列出的命名空间的并集。null 选择器以及 null 或空命名空间列表表示“此 Pod 的命名空间”。空选择器 ({}) 会匹配所有命名空间。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions
object
可选
matchExpressions 是标签选择器要求的列表。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.key
string
必需
key 是选择器所应用于的标签键。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.operator
string
必需
operator 表示键与一组值之间的关系。有效的运算符包括 InNotInExistsDoesNotExist
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchExpressions.values
string
可选
values 是字符串值的数组。如果运算符为 In 或 NotIn,则值数组必须为非空。如果运算符为 Exists 或 DoesNotExist,则值数组必须为空。此数组会在策略合并补丁运行期间被替换。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaceSelector.matchLabels
object
可选
matchLabels 是 {key,value} 对的映射。matchLabels 映射中的单个 {key,value} 等效于 matchExpressions 的一个元素,其键字段为“key”,运算符为“In”,值数组仅包含“value”。这些要求会进行 AND 运算。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.namespaces
string
可选
namespaces 指定相关项所应用于的命名空间名称的静态列表。相关项会应用于此字段中列出的命名空间与 namespaceSelector 选择的命名空间的并集。null 或空命名空间列表以及 null namespaceSelector 表示“此 Pod 的命名空间”。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey
string
必需
此 Pod 必须与指定命名空间中与 labelSelector 匹配的 Pod 共置(亲和性)或不共置(反亲和性)。共置的定义是:运行所在节点的键为 topologyKey 的标签值与任何所选 Pod 运行所在的任何节点的相应标签匹配。不允许 topologyKey 为空。
podSpec.schedulingConfig.tolerations
object
可选
Tolerations 使您可以管理是允许还是禁止在应用了特定污点的 Kubernetes 节点上调度实例。
podSpec.schedulingConfig.tolerations.effect
string
可选
Effect 指示要匹配的污点效果。空表示匹配所有污点效果。如果指定,则允许的值包括 NoSchedule、PreferNoSchedule 和 NoExecute。
podSpec.schedulingConfig.tolerations.key
string
可选
Key 是容忍所应用于的污点键。空表示匹配所有污点键。如果键为空,运算符必须为 Exists。此组合表示匹配所有值和所有键。
podSpec.schedulingConfig.tolerations.operator
string
可选
Operator 表示键与值之间的关系。有效的运算符包括 ExistsEqual。默认值为 EqualExists 等效于对值使用通配符,以便 Pod 可以容忍特定类别的所有污点。
podSpec.schedulingConfig.tolerations.tolerationSeconds
integer
可选
TolerationSeconds 表示容忍(必须为 NoExecute 效果,否则系统会忽略此字段)可容忍污点的时间段。默认情况下,此字段未设置,这表示永久容忍污点(不逐出)。系统会将零值和负值视为 0(立即逐出)。
podSpec.schedulingConfig.tolerations.value
string
可选
Value 是容忍所匹配的污点值。如果运算符为 Exists,则值必须为空;否则,它必须是常规字符串。
replicaCount
integer
可选
ReplicaCount 定义要部署的 PgBouncer 副本数量。
serverTLS
object
可选
ServerTLSSpec 定义 PgBouncer 用于连接到数据库集群以进行身份验证查询的加密通信的证书 Secret。
serverTLS.certSecret
object
可选
CertSecret 引用同一命名空间中的证书 Secret。此 Secret 必须包含 ca.crt(CA 证书)、tls.key(私钥)和 tls.crt(叶证书)条目。此 Secret 中的值用于填充 pgbouncer.ini 中的 server_tls_ca_file、server_tls_cert_file 和 server_tls_key_file。CA 证书必须与对数据库集群叶证书进行签名的 CA 一致。叶证书必须包含 CommonName“alloydbpgbouncer”。
serverTLS.certSecret.name
string
可选
引用对象的名称。详细信息:使用对象#名称
serviceOptions
object
必需
ServiceOptions 定义用于访问 PgBouncer Pod 的连接选项。
serviceOptions.annotations
object
可选
客户提供的注解会添加到 loadbalancer 类型的服务对象中。
serviceOptions.gcp
object
可选
GCP 包含 Kubernetes LoadBalancer 的 Google Cloud 特有属性。
serviceOptions.gcp.loadBalancerIP
integer or string
可选
LoadBalancerIP 是静态 IP 地址,请参阅预留静态外部 IP 地址
serviceOptions.gcp.loadBalancerType
string
可选
负载均衡器可以是内部的,也可以是外部的。请参阅内部负载均衡器
serviceOptions.type
string
必需
用于访问 PgBouncer Pod 的 Kubernetes 服务的类型。它可以具有以下值:LoadBalancerClusterIP

状态架构

PgBouncerStatus 定义观察到的 PgBouncer 状态。

ipAddress: string
phase: string

字段

类型
必需或可选

 

说明
ipAddress
string
必需
ipAddress 是可进行连接以访问数据库的 PgBouncer 端点。
phase
string
必需
phase 描述 PgBouncer 部署的状态。此处会显示 WaitingForDeploymentReady、Acquiring IP、Ready 等值。