PersistentVolumeClaim
apiVersion: v1
import "k8s.io/api/core/v1"
PersistentVolumeClaim
PersistentVolumeClaim 是使用者對持久卷的請求和宣告
apiVersion: v1
kind: PersistentVolumeClaim
metadata (ObjectMeta)
標準物件的元資料。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (PersistentVolumeClaimSpec)
spec 定義了 Pod 作者請求的卷的期望特性。更多資訊: https://kubernetes.club.tw/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
status (PersistentVolumeClaimStatus)
status 表示持久卷宣告的當前資訊/狀態。只讀。更多資訊: https://kubernetes.club.tw/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
PersistentVolumeClaimSpec
PersistentVolumeClaimSpec 描述了儲存裝置的通用屬性,並允許指定供應商特定的屬性源
accessModes ([]string)
原子性:在合併期間將被替換
accessModes 包含卷應具有的期望訪問模式。更多資訊: https://kubernetes.club.tw/docs/concepts/storage/persistent-volumes#access-modes-1
selector (LabelSelector)
selector 是用於標籤查詢,以考慮繫結到哪些卷。
resources (VolumeResourceRequirements)
resources 表示卷應具有的最小資源。如果啟用了 RecoverVolumeExpansionFailure 功能,則允許使用者指定低於先前值但仍高於宣告狀態欄位中記錄容量的資源需求。更多資訊: https://kubernetes.club.tw/docs/concepts/storage/persistent-volumes#resources
VolumeResourceRequirements 描述了卷的儲存資源需求。
resources.limits (map[string]Quantity)
Limits 描述了允許的最大計算資源量。更多資訊: https://kubernetes.club.tw/docs/concepts/configuration/manage-resources-containers/
resources.requests (map[string]Quantity)
Requests 描述了所需的最小計算資源量。如果容器省略 Requests,則預設為 Limits(如果已明確指定),否則為實現定義的預設值。Requests 不能超過 Limits。更多資訊: https://kubernetes.club.tw/docs/concepts/configuration/manage-resources-containers/
volumeName (string)
volumeName 是此宣告所支援的 PersistentVolume 的繫結引用。
storageClassName (string)
storageClassName 是宣告所需的 StorageClass 的名稱。更多資訊: https://kubernetes.club.tw/docs/concepts/storage/persistent-volumes#class-1
volumeMode (string)
volumeMode 定義了宣告所需的卷型別。當宣告規範中未包含時,預設為 Filesystem。
Beta 級別
dataSource (TypedLocalObjectReference)
dataSource 欄位可用於指定以下任一內容:* 現有的 VolumeSnapshot 物件 (snapshot.storage.k8s.io/VolumeSnapshot) * 現有的 PVC (PersistentVolumeClaim) 如果 provisioner 或外部控制器支援指定的資料來源,它將根據指定資料來源的內容建立一個新卷。當啟用 AnyVolumeDataSource 功能門時, dataSource 內容將被複制到 dataSourceRef,並且當 dataSourceRef.namespace 未指定時,dataSourceRef 內容將被複制到 dataSource。如果指定了名稱空間,則 dataSourceRef 不會被複制到 dataSource。
dataSourceRef (TypedObjectReference)
dataSourceRef 指定了要從中填充卷資料的物件(如果需要非空卷)。這可以是來自非空 API 組(非核心物件)的任何物件,也可以是 PersistentVolumeClaim 物件。當指定此欄位時,僅當指定物件的型別與某些已安裝的卷填充器或動態 provisioner 匹配時,卷繫結才會成功。此欄位將取代 dataSource 欄位的功能,因此如果兩個欄位都非空,則它們必須具有相同的值。為了向後相容,當 dataSourceRef 中未指定名稱空間時,如果其中一個欄位為空而另一個非空,則兩個欄位(dataSource 和 dataSourceRef)將自動設定為相同的值。當在 dataSourceRef 中指定了名稱空間時, dataSource 不會設定為相同的值,並且必須為空。dataSource 和 dataSourceRef 之間有三個重要區別:* dataSource 只允許兩種特定型別的物件,而 dataSourceRef 允許任何非核心物件以及 PersistentVolumeClaim 物件。
- dataSource 忽略不允許的值(將其丟棄),而 dataSourceRef 保留所有值,並在指定不允許的值時生成錯誤。
- dataSource 只允許本地物件,而 dataSourceRef 允許任何名稱空間中的物件。(Beta)使用此欄位需要啟用 AnyVolumeDataSource 功能門。(Alpha)使用 dataSourceRef 的 namespace 欄位需要啟用 CrossNamespaceVolumeDataSource 功能門。
TypedObjectReference 包含足夠的資訊,以便您可以找到型別化的引用物件
dataSourceRef.kind (string), required
Kind 是所引用資源的型別
dataSourceRef.name (string), required
Name 是所引用資源的名稱
dataSourceRef.apiGroup (string)
APIGroup 是被引用資源的組。如果未指定 APIGroup,則指定的 Kind 必須位於核心 API 組中。對於任何其他第三方型別,APIGroup 是必需的。
dataSourceRef.namespace (string)
Namespace 是被引用資源的名稱空間。請注意,當指定名稱空間時,在引用名稱空間中需要一個 gateway.networking.k8s.io/ReferenceGrant 物件,以允許該名稱空間的所有者接受該引用。有關詳細資訊,請參閱 ReferenceGrant 文件。(Alpha)此欄位需要啟用 CrossNamespaceVolumeDataSource 功能門。
volumeAttributesClassName (string)
volumeAttributesClassName 可用於設定此宣告使用的 VolumeAttributesClass。如果指定,CSI 驅動程式將使用相應 VolumeAttributesClass 中定義的屬性建立或更新卷。這與 storageClassName 的目的不同,它可以在宣告建立後進行更改。空字串或 nil 值表示沒有 VolumeAttributesClass 將應用於該宣告。如果宣告進入 Infeasible 錯誤狀態,可以將此欄位重置為先前的值(包括 nil)以取消修改。如果 volumeAttributesClass 引用的資源不存在,此 PersistentVolumeClaim 將設定為 Pending 狀態,如 modifyVolumeStatus 欄位所示,直到該資源存在為止。更多資訊: https://kubernetes.club.tw/docs/concepts/storage/volume-attributes-classes/
PersistentVolumeClaimStatus
PersistentVolumeClaimStatus 是持久卷宣告的當前狀態。
accessModes ([]string)
原子性:在合併期間將被替換
accessModes 包含卷支援 PVC 的實際訪問模式。更多資訊: https://kubernetes.club.tw/docs/concepts/storage/persistent-volumes#access-modes-1
allocatedResourceStatuses (map[string]string)
allocatedResourceStatuses 儲存了給定 PVC 的正在調整大小的資源的狀態。鍵名遵循標準的 Kubernetes 標籤語法。有效值可以是:* 沒有字首的鍵:- storage - 卷的容量。* 自定義資源必須使用實現定義的帶字首的名稱,例如“example.com/my-custom-resource”。除了以上值之外,未加字首或帶有 kubernetes.io 字首的鍵被視為保留,因此不得使用。
ClaimResourceStatus 可以處於以下任何狀態:- ControllerResizeInProgress:當 resize 控制器在控制平面開始調整卷大小時設定的狀態。- ControllerResizeFailed:當 resize 在控制平面中因終結錯誤而失敗時設定的狀態。- NodeResizePending:當 resize 控制器完成卷大小調整,但需要在節點上進行進一步調整時設定的狀態。- NodeResizeInProgress:當 kubelet 開始調整卷大小時設定的狀態。- NodeResizeFailed:當 resizing 在 kubelet 中因終結錯誤而失敗時設定的狀態。瞬時錯誤不會設定 NodeResizeFailed。例如:如果擴充套件 PVC 以獲取更多容量 - 此欄位可以是以下狀態之一:- pvc.status.allocatedResourceStatus['storage'] = "ControllerResizeInProgress" - pvc.status.allocatedResourceStatus['storage'] = "ControllerResizeFailed" - pvc.status.allocatedResourceStatus['storage'] = "NodeResizePending" - pvc.status.allocatedResourceStatus['storage'] = "NodeResizeInProgress" - pvc.status.allocatedResourceStatus['storage'] = "NodeResizeFailed" 當未設定此欄位時,表示沒有正在進行的 PVC 調整大小操作。
接收到先前未知 resourceName 或 ClaimResourceStatus 的 PVC 更新的控制器應忽略該更新,以實現其設計目的。例如 - 僅負責調整卷容量大小的控制器應忽略更改 PVC 相關其他有效資源的 PVC 更新。
這是一個 Alpha 欄位,需要啟用 RecoverVolumeExpansionFailure 功能。
allocatedResources (map[string]Quantity)
allocatedResources 跟蹤分配給 PVC 的資源,包括其容量。鍵名遵循標準的 Kubernetes 標籤語法。有效值可以是:* 沒有字首的鍵:- storage - 卷的容量。* 自定義資源必須使用實現定義的帶字首的名稱,例如“example.com/my-custom-resource”。除了以上值之外,未加字首或帶有 kubernetes.io 字首的鍵被視為保留,因此不得使用。
當請求卷擴充套件操作時,此處報告的容量可能大於實際容量。對於儲存配額,將使用 allocatedResources 和 PVC.spec.resources 中的較大值。如果未設定 allocatedResources,則僅使用 PVC.spec.resources 進行配額計算。如果卷擴充套件容量請求降低,則僅當沒有正在進行的擴充套件操作且實際卷容量等於或低於請求容量時,allocatedResources 才會降低。
接收到先前未知 resourceName 的 PVC 更新的控制器應忽略該更新,以實現其設計目的。例如 - 僅負責調整卷容量大小的控制器應忽略更改 PVC 相關其他有效資源的 PVC 更新。
這是一個 Alpha 欄位,需要啟用 RecoverVolumeExpansionFailure 功能。
capacity (map[string]Quantity)
capacity 表示底層卷的實際資源。
conditions ([]PersistentVolumeClaimCondition)
補丁策略:按鍵
type
合併對映:合併時將保留鍵型別上的唯一值
conditions 是持久卷宣告的當前 Condition。如果底層持久卷正在調整大小,則 Condition 將設定為 'Resizing'。
PersistentVolumeClaimCondition 包含 pvc 狀態的詳細資訊
conditions.status (string),必需
Status 是 Condition 的狀態。可以是 True、False、Unknown。更多資訊: https://kubernetes.club.tw/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=state%20of%20pvc-,conditions.status,-(string)%2C%20required
conditions.type (string),必需
Type 是 Condition 的型別。更多資訊: https://kubernetes.club.tw/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#:~:text=set%20to%20%27ResizeStarted%27.-,PersistentVolumeClaimCondition,-contains%20details%20about
conditions.lastProbeTime (Time)
lastProbeTime 是我們探測 Condition 的時間。
Time 是 time.Time 的一個包裝器,支援正確地編組到 YAML 和 JSON。提供了 time 包提供的許多工廠方法的包裝器。
conditions.lastTransitionTime (Time)
lastTransitionTime 是 Condition 從一個狀態轉換到另一個狀態的時間。
Time 是 time.Time 的一個包裝器,支援正確地編組到 YAML 和 JSON。提供了 time 包提供的許多工廠方法的包裝器。
conditions.message (string)
message 是指示最後一次轉換詳細資訊的易讀訊息。
conditions.reason (string)
reason 是一個唯一的、機器可理解的短字串,表示 Condition 最後一次轉換的原因。如果報告“Resizing”,則表示底層持久卷正在調整大小。
currentVolumeAttributesClassName (string)
currentVolumeAttributesClassName 是 PVC 當前使用的 VolumeAttributesClass 的名稱。當未設定時,此 PersistentVolumeClaim 沒有應用 VolumeAttributeClass
modifyVolumeStatus (ModifyVolumeStatus)
ModifyVolumeStatus 表示 ControllerModifyVolume 操作的狀態物件。當未設定時,沒有正在嘗試的 ModifyVolume 操作。
ModifyVolumeStatus 表示 ControllerModifyVolume 操作的狀態物件
modifyVolumeStatus.status (string), required
status 是 ControllerModifyVolume 操作的狀態。它可以處於以下任何狀態
- Pending Pending 表示 PersistentVolumeClaim 由於未滿足的要求(例如,指定的 VolumeAttributesClass 不存在)而無法修改。
- InProgress InProgress 表示卷正在被修改。
- Infeasible Infeasible 表示請求已被 CSI 驅動程式拒絕為無效。要解決此錯誤,需要指定一個有效的 VolumeAttributesClass。注意:未來可能會新增新的狀態。使用者應檢查未知狀態並適當處理失敗。
modifyVolumeStatus.targetVolumeAttributesClassName (string)
targetVolumeAttributesClassName 是 PVC 當前正在協調的 VolumeAttributesClass 的名稱
phase (string)
phase 表示 PersistentVolumeClaim 的當前階段。
PersistentVolumeClaimList
PersistentVolumeClaimList 是 PersistentVolumeClaim 項的列表。
apiVersion: v1
kind: PersistentVolumeClaimList
metadata (ListMeta)
標準列表元資料。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]PersistentVolumeClaim), required
items 是持久卷宣告的列表。更多資訊: https://kubernetes.club.tw/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
操作
get
讀取指定的 PersistentVolumeClaim
HTTP 請求
GET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
引數
name (在路徑中): string,必填
PersistentVolumeClaim 的名稱
namespace (在路徑中): string,必填
pretty (在查詢中): string
響應
200 (PersistentVolumeClaim): OK
401: 未授權
get
讀取指定 PersistentVolumeClaim 的狀態
HTTP 請求
GET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status
引數
name (在路徑中): string,必填
PersistentVolumeClaim 的名稱
namespace (在路徑中): string,必填
pretty (在查詢中): string
響應
200 (PersistentVolumeClaim): OK
401: 未授權
list
列出或監視 PersistentVolumeClaim 型別的物件
HTTP 請求
GET /api/v1/namespaces/{namespace}/persistentvolumeclaims
引數
namespace (在路徑中): string,必填
allowWatchBookmarks (在查詢中): boolean
continue (在查詢中): string
fieldSelector (在查詢中): string
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
watch (在查詢中): boolean
響應
200 (PersistentVolumeClaimList): OK
401: 未授權
list
列出或監視 PersistentVolumeClaim 型別的物件
HTTP 請求
GET /api/v1/persistentvolumeclaims
引數
allowWatchBookmarks (在查詢中): boolean
continue (在查詢中): string
fieldSelector (在查詢中): string
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
watch (在查詢中): boolean
響應
200 (PersistentVolumeClaimList): OK
401: 未授權
create
建立一個 PersistentVolumeClaim
HTTP 請求
POST /api/v1/namespaces/{namespace}/persistentvolumeclaims
引數
namespace (在路徑中): string,必填
body: PersistentVolumeClaim, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
202 (PersistentVolumeClaim): Accepted
401: 未授權
update
替換指定的 PersistentVolumeClaim
HTTP 請求
PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
引數
name (在路徑中): string,必填
PersistentVolumeClaim 的名稱
namespace (在路徑中): string,必填
body: PersistentVolumeClaim, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
401: 未授權
update
替換指定 PersistentVolumeClaim 的狀態
HTTP 請求
PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status
引數
name (在路徑中): string,必填
PersistentVolumeClaim 的名稱
namespace (在路徑中): string,必填
body: PersistentVolumeClaim, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
401: 未授權
patch
部分更新指定的 PersistentVolumeClaim
HTTP 請求
PATCH /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
引數
name (在路徑中): string,必填
PersistentVolumeClaim 的名稱
namespace (在路徑中): string,必填
body: Patch,必需
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
force (在查詢中): boolean
pretty (在查詢中): string
響應
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
401: 未授權
patch
部分更新指定 PersistentVolumeClaim 的狀態
HTTP 請求
PATCH /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status
引數
name (在路徑中): string,必填
PersistentVolumeClaim 的名稱
namespace (在路徑中): string,必填
body: Patch,必需
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
force (在查詢中): boolean
pretty (在查詢中): string
響應
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
401: 未授權
delete
刪除一個 PersistentVolumeClaim
HTTP 請求
DELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
引數
name (在路徑中): string,必填
PersistentVolumeClaim 的名稱
namespace (在路徑中): string,必填
body: DeleteOptions
dryRun (在查詢中): string
gracePeriodSeconds (在查詢中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查詢中): boolean
pretty (在查詢中): string
propagationPolicy (在查詢中): string
響應
200 (PersistentVolumeClaim): OK
202 (PersistentVolumeClaim): Accepted
401: 未授權
deletecollection
刪除 PersistentVolumeClaim 的集合
HTTP 請求
DELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims
引數
namespace (在路徑中): string,必填
body: DeleteOptions
continue (在查詢中): string
dryRun (在查詢中): string
fieldSelector (在查詢中): string
gracePeriodSeconds (在查詢中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查詢中): boolean
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
propagationPolicy (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
響應
200 (Status): OK
401: 未授權
本頁面是自動生成的。
如果你打算報告此頁面存在的問題,請在問題描述中提及此頁面是自動生成的。修復可能需要在 Kubernetes 專案的其他地方進行。