Managed Lustre CSI 驅動程式參考資料

下列資訊清單說明 StorageClass 和 PersistentVolume 資源中支援的 CSI 驅動程式欄位。

儲存空間級別

下列資訊清單包含 StorageClass 中所有支援的欄位。

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: lustre-csi-example-storage-class
provisioner: lustre.csi.storage.gke.io
parameters:
  network: VPC_NETWORK # optional
  filesystem: LUSTRE_FILESYSTEM_NAME # optional
  labels: KEY_1=VALUE_1,KEY_2=VALUE_2,...,KEY_N=VALUE_N # optional
  description: DESCRIPTION # optional
  perUnitStorageThroughput: 125 | 250 | 500 | 1000  # required
volumeBindingMode: WaitForFirstConsumer | Immediate # default is Immediate
allowedTopologies:
- matchLabelExpressions:
  - key: topology.gke.io/zone
    values:
    - ZONE_1
    - ZONE_2
mountOptions:
  - LUSTRE_MOUNT_OPTIONS

替換下列值:

  • network:選用。用來建立 Managed Lustre 執行個體的虛擬私有雲 (VPC) 網路。 如未指定這項屬性,系統會使用預設網路。

    如要在共用 VPC 網路中建立 Managed Lustre 執行個體,必須提供網路全名。例如 projects/PROJECT_ID/global/networks/VPC_NETWORK_NAME

  • filesystem:指定 Managed Lustre 執行個體的 fsname。這個參數用於動態佈建fsname 必須是英數字串,最多八個字元,開頭為字母。如未提供值,CSI 驅動程式會產生格式為 "lfsNNNNN"fsname (例如 "lfs97603")。

  • labels:選用。 Managed Lustre 支援每個執行個體的標籤,以鍵/值組合的對應形式呈現。透過 Managed Lustre CSI 驅動程式,您可以將使用者提供的標籤附加至執行個體。

  • description:選用。執行個體的說明,長度不得超過 2,048 個字元。

  • perUnitStorageThroughput:指定執行個體的每單位儲存空間處理量 (MB/s/TiB)。支援的值為 1252505001000。預設值為 1000

  • allowTopologies:選用。Managed Lustre 執行個體是區域資源。如未指定這個屬性,系統會在 CSI 控制器驅動程式 Pod 所在的區域中建立 Managed Lustre 執行個體,且磁碟區繫結模式預設為 Immediate

    如果指定 WaitForFirstConsumer,拓撲會設為 Pod 的排程位置。不過,如果 Pod 等待佈建磁碟區,這項設定可能會導致 Pod 遭到封鎖。

    Managed Lustre CSI 驅動程式支援拓撲功能,可確保永久磁碟區和 Pod 會根據 StorageClass 中提供的拓撲,放置在允許的拓撲中。

  • mountOptions:選用。指定 mount.lustre 掛接選項。受管理 Lustre 磁碟區會從 pv.spec.mountOptions 欄位的 StorageClass 繼承這些掛接選項。

永久磁碟區

下列資訊清單包含 PersistentVolume 中所有支援的欄位。

apiVersion: v1
kind: PersistentVolume
metadata:
 name: preprov-pv
 annotations:
   pv.kubernetes.io/provisioned-by: lustre.csi.storage.gke.io
spec:
 mountOptions:
   - LUSTRE_MOUNT_OPTIONS
   ...
 storageClassName: ""
 capacity:
   storage: CAPACITY
 accessModes:
   - ReadWriteMany
 persistentVolumeReclaimPolicy: Retain
 volumeMode: Filesystem
 csi:
   driver: lustre.csi.storage.gke.io
   volumeHandle: EXISTING_LUSTRE_INSTANCE_NAME
   volumeAttributes:
     ip: EXISTING_LUSTRE_IP_ADDRESS
     filesystem: EXISTING_LUSTRE_FSNAME

替換下列值:

  • capacity.storage:Managed Lustre 執行個體的容量。如需支援的執行個體容量下限和上限,請參閱「效能層級」。
  • mountOptions:指定 mount.lustre 掛接選項。這個值會從 StorageClass 中的 mountOptions 欄位繼承。
  • csi.volumeHandle:Managed Lustre 執行個體的專屬 ID。必須使用下列格式:PROJECT_ID/LOCATION/INSTANCE_NAME
  • csi.volumeAttributes.ip:用於掛接的受管理 Lustre 執行個體 IP 位址。
  • csi.volumeAttributes.filesystem:Managed Lustre 執行個體的檔案系統名稱,為八個字元的 ID。