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 連線的 rw (讀寫) 或 ro (唯讀) 存取模式。預設值為 ro。
allowSuperUserAccess
boolean
選填
AllowSuperUserAccess 可設為 true 或 false
dbclusterRef
string
必填
DBClusterRef 是 PgBouncer 集區連線的 DBCluster 名稱。您必須在 PgBouncer 物件參照的 DBCluster 所在命名空間中建立該物件。如要使用 PgBouncer 連線集區,必須填寫這個欄位。
parameters
object
選填
參數會保留可設定的各種 PgBouncer 設定鍵/值組合。請參閱 https://www.pgbouncer.org/config.html,瞭解各種可用選項。 建立 PgBouncer 服務 提供一些採用這項規格的範例。
podspec
object
必填
PodSpec 包含 PgBouncer Pod 的規格。其中包含為 PgBouncer Pod 提供服務的映像檔、運算和儲存資源,以及排程選項。
podSpec.image
string
必填
映像檔是 Artifact Registry 中自訂 pgbouncer 映像檔的統一資源 ID。
podSpec.resources
object
必填
資源代表目前的記憶體和 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
必填
代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchExpressions.values
string
選填
字串值陣列。如果運算子為 In 或 NotIn,則值陣列不得為空白。如果運算子為 Exists 或 DoesNotExist,值陣列必須為空白。如果運算子是 Gt 或 Lt,則值陣列必須包含單一元素,且該元素會解讀為整數。這個陣列會在策略性合併修補期間遭到取代。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields
object
選填
依節點欄位列出的節點選取器需求清單。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.key
string
必填
選取器套用的標籤鍵。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.operator
string
必填
代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.preference.matchFields.values
string
選填
字串值陣列。如果運算子為 In 或 NotIn,則值陣列不得為空。如果運算子為 Exists 或 DoesNotExist,值陣列必須為空白。如果運算子是 Gt 或 Lt,值陣列必須包含單一元素,且會解讀為整數。這個陣列會在策略性合併修補期間遭到取代。
podSpec.schedulingConfig.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight
integer
必填
與比對對應 nodeSelectorTerm 相關聯的權重,範圍介於 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
必填
代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
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
必填
代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
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
必填
運算子代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists 和 DoesNotExist。
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
選填
針對字詞適用的命名空間集,執行標籤查詢。這個字詞會套用至這個欄位所選命名空間和命名空間欄位所列命名空間的聯集。空值選取器和空值或空白命名空間清單代表「這個 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
必填
運算子代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists 和 DoesNotExist。
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 所選命名空間的聯集。如果命名空間清單為空值或空白,且 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
必填
運算子代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists 和 DoesNotExist。
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
選填
針對字詞適用的命名空間集,執行標籤查詢。這個字詞會套用至這個欄位所選命名空間和命名空間欄位所列命名空間的聯集。空值選取器和空值或空白命名空間清單代表「這個 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
必填
運算子代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
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 所選命名空間的聯集。如果命名空間清單為空值或空白,且 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
必填
運算子代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists 和 DoesNotExist。
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
選填
針對字詞適用的命名空間集,執行標籤查詢。這個字詞會套用至這個欄位所選命名空間和命名空間欄位所列命名空間的聯集。空值選取器和空值或空白命名空間清單代表「這個 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
必填
運算子代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists 和 DoesNotExist。
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 所選命名空間的聯集。如果命名空間清單為空值或空白,且 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
必填
運算子代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists 和 DoesNotExist。
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
選填
針對字詞適用的命名空間集,執行標籤查詢。這個字詞會套用至這個欄位所選命名空間和命名空間欄位所列命名空間的聯集。空值選取器和空值或空白命名空間清單代表「這個 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
必填
運算子代表鍵與一組值的關係。有效運算子為 In、NotIn、Exists 和 DoesNotExist。
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 所選命名空間的聯集。如果命名空間清單為空值或空白,且 namespaceSelector 為空值,則代表「這個 Pod 的命名空間」。
podSpec.schedulingConfig.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution.topologyKey
string
必填
這個 Pod 必須與指定命名空間中符合 labelSelector 的 Pod 位於相同位置 (親和性),或位於不同位置 (反親和性)。「共置」是指在節點上執行,且該節點的標籤值 (鍵為 topologyKey) 與任何執行所選 Pod 的節點標籤值相符。topologyKey 不得留空。
podSpec.schedulingConfig.tolerations
object
選填
容忍度可讓您管理是否允許在套用特定污點的 Kubernetes 節點上排定執行個體。
podSpec.schedulingConfig.tolerations.effect
string
選填
「Effect」代表要比對的污點效果。如果留空,則代表比對所有污點影響。指定時,允許的值為 NoSchedule、PreferNoSchedule 和 NoExecute。
podSpec.schedulingConfig.tolerations.key
string
選填
「Key」是容忍度套用的污點鍵。如果留空,則代表比對所有污點索引鍵。如果鍵為空白,運算子必須為 Exists。這個組合代表比對所有值和所有鍵。
podSpec.schedulingConfig.tolerations.operator
string
選填
運算子代表鍵與值的關係。有效運算子為 Exists 和 Equal。預設為 Equal。Exists 相當於值的萬用字元,因此 Pod 可以容忍特定類別的所有污點。
podSpec.schedulingConfig.tolerations.tolerationSeconds
integer
選填
TolerationSeconds 代表容忍度 (必須為 NoExecute 效果,否則系統會忽略這個欄位) 容忍污點的時間長度。根據預設,這個欄位不會設定,也就是永遠容許 taint (不予剔除)。系統會將零和負值視為 0 (立即淘汰)。
podSpec.schedulingConfig.tolerations.value
string
選填
值是容忍度比對的污點值。如果運算子為 Exists,值必須為空白,否則必須是一般字串。
replicaCount
integer
選填
ReplicaCount 定義要部署的 PgBouncer 副本數量。
serverTLS
object
選填
ServerTLSSpec 定義了加密通訊的憑證密鑰,PgBouncer 會使用該密鑰連線至資料庫叢集,以執行驗證查詢。
serverTLS.certSecret
object
選填
CertSecret 會參照相同命名空間中的憑證 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
選填
LoadBalancer 可以是內部或外部。請參閱「內部負載平衡器」。
serviceOptions.type
string
必填
用於存取 PgBouncer Pod 的 Kubernetes 服務類型。可能的值為 LoadBalancer 或 ClusterIP。

狀態結構定義

PgBouncerStatus 定義 PgBouncer 的觀測狀態。

ipAddress: string
phase: string

欄位

類型
必填或選填

 

說明
ipAddress
string
必填
ipAddress 是 PgBouncer 端點,可連結至該端點來存取資料庫。
phase
string
必填
phase 說明 PgBouncer Deployment 的狀態。這裡會顯示 WaitingForDeploymentReady、Acquiring IP、Ready 等值。