HorizontalPodAutoscaler

水平 Pod 自動擴充器的組態。

apiVersion: autoscaling/v1

import "k8s.io/api/autoscaling/v1"

HorizontalPodAutoscaler

水平 Pod 自動擴充器的組態。


HorizontalPodAutoscalerSpec

水平 Pod 自動擴充器的規格。


  • maxReplicas (int32), 必填

    maxReplicas 是自動擴充器可以設定的 Pod 數目上限;不能小於 MinReplicas。

  • scaleTargetRef (CrossVersionObjectReference), 必填

    參考擴充資源;水平 Pod 自動擴充器將學習目前的資源消耗,並將使用其 Scale 子資源設定所需的 Pod 數目。

    CrossVersionObjectReference 包含足夠的資訊,讓您識別參考的資源。

  • minReplicas (int32)

    minReplicas 是自動擴充器可以縮減的副本數目下限。 預設值為 1 個 Pod。 如果啟用 alpha 功能閘道 HPAScaleToZero,且至少設定一個物件或外部指標,則允許 minReplicas 為 0。 只要至少有一個指標值可用,擴充就會處於作用中。

  • targetCPUUtilizationPercentage (int32)

    targetCPUUtilizationPercentage 是所有 Pod 的目標平均 CPU 使用率(表示為請求 CPU 的百分比);如果未指定,將使用預設的自動擴充策略。

HorizontalPodAutoscalerStatus

水平 Pod 自動擴充器的目前狀態


  • currentReplicas (int32), 必填

    currentReplicas 是由此自動擴充器管理的 Pod 的目前副本數目。

  • desiredReplicas (int32), 必填

    desiredReplicas 是由此自動擴充器管理的 Pod 的所需副本數目。

  • currentCPUUtilizationPercentage (int32)

    currentCPUUtilizationPercentage 是所有 Pod 的目前平均 CPU 使用率,以要求的 CPU 百分比表示,例如 70 代表平均 Pod 目前使用其要求的 CPU 的 70%。

  • lastScaleTime (時間)

    lastScaleTime 是水平 Pod 自動擴展器上次擴展 Pod 數量的時間;autoscaler 使用此時間來控制變更 Pod 數量的頻率。

    Time 是 time.Time 的包裝器,支援正確地封送至 YAML 和 JSON。包裝器是為 time 套件提供的許多工廠方法而提供的。

  • observedGeneration (int64)

    observedGeneration 是此自動擴展器觀察到的最新世代。

HorizontalPodAutoscalerList

水平 pod 自動擴展器物件的清單。


  • apiVersion: autoscaling/v1

  • 種類: HorizontalPodAutoscalerList

  • metadata (ListMeta)

    標準清單 metadata。

  • items ([]HorizontalPodAutoscaler), 必要

    items 是水平 pod 自動擴展器物件的清單。

操作


get 讀取指定的 HorizontalPodAutoscaler

HTTP 請求

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

參數

  • name (在路徑中): 字串, 必要

    HorizontalPodAutoscaler 的名稱

  • namespace (在路徑中): 字串, 必要

    命名空間

  • pretty (在查詢中): 字串

    pretty

回應

200 (HorizontalPodAutoscaler): 成功

401: 未經授權

get 讀取指定 HorizontalPodAutoscaler 的狀態

HTTP 請求

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

參數

  • name (在路徑中): 字串, 必要

    HorizontalPodAutoscaler 的名稱

  • namespace (在路徑中): 字串, 必要

    命名空間

  • pretty (在查詢中): 字串

    pretty

回應

200 (HorizontalPodAutoscaler): 成功

401: 未經授權

list 列出或監看 HorizontalPodAutoscaler 種類的物件

HTTP 請求

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

參數

回應

200 (HorizontalPodAutoscalerList): 成功

401: 未經授權

list 列出或監看 HorizontalPodAutoscaler 種類的物件

HTTP 請求

GET /apis/autoscaling/v1/horizontalpodautoscalers

參數

回應

200 (HorizontalPodAutoscalerList): 成功

401: 未經授權

create 建立 HorizontalPodAutoscaler

HTTP 請求

POST /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

參數

回應

200 (HorizontalPodAutoscaler): 成功

201 (HorizontalPodAutoscaler): 已建立

202 (HorizontalPodAutoscaler): 已接受

401: 未經授權

update 取代指定的 HorizontalPodAutoscaler

HTTP 請求

PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

參數

回應

200 (HorizontalPodAutoscaler): 成功

201 (HorizontalPodAutoscaler): 已建立

401: 未經授權

update 取代指定 HorizontalPodAutoscaler 的狀態

HTTP 請求

PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

參數

回應

200 (HorizontalPodAutoscaler): 成功

201 (HorizontalPodAutoscaler): 已建立

401: 未經授權

patch 部分更新指定的 HorizontalPodAutoscaler

HTTP 請求

PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

參數

  • name (在路徑中): 字串, 必要

    HorizontalPodAutoscaler 的名稱

  • namespace (在路徑中): 字串, 必要

    命名空間

  • body: Patch, 必要

  • dryRun (在查詢中): 字串

    dryRun

  • fieldManager (在查詢中): 字串

    fieldManager

  • fieldValidation (在查詢中): 字串

    fieldValidation

  • force (在查詢中): 布林值

    force

  • pretty (在查詢中): 字串

    pretty

回應

200 (HorizontalPodAutoscaler): 成功

201 (HorizontalPodAutoscaler): 已建立

401: 未經授權

patch 部分更新指定 HorizontalPodAutoscaler 的狀態

HTTP 請求

PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

參數

  • name (在路徑中): 字串, 必要

    HorizontalPodAutoscaler 的名稱

  • namespace (在路徑中): 字串, 必要

    命名空間

  • body: Patch, 必要

  • dryRun (在查詢中): 字串

    dryRun

  • fieldManager (在查詢中): 字串

    fieldManager

  • fieldValidation (在查詢中): 字串

    fieldValidation

  • force (在查詢中): 布林值

    force

  • pretty (在查詢中): 字串

    pretty

回應

200 (HorizontalPodAutoscaler): 成功

201 (HorizontalPodAutoscaler): 已建立

401: 未經授權

delete 刪除 HorizontalPodAutoscaler

HTTP 請求

DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

參數

回應

200 (Status): 成功

202 (Status): 已接受

401: 未經授權

deletecollection 刪除 HorizontalPodAutoscaler 的集合

HTTP 請求

DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

參數

回應

200 (Status): 成功

401: 未經授權

此頁面為自動產生。

如果您計劃回報此頁面的問題,請在您的問題描述中提及此頁面為自動產生。此修正可能需要在 Kubernetes 專案中的其他地方進行。

上次修改時間為 2024 年 8 月 28 日下午 6:01 PST:更新 v1.31 的自動產生 API 參考 (8ba98c79c1)