メインコンテンツへスキップ

Trident CSI ドライバーを使用する場合、Kubernetes Persistent Volume (PV) (ext4 または XFS) をバックアップするファイルシステムのサイズを増やすためのベストプラクティスは何ですか?

Views:
11
Visibility:
Public
Votes:
0
Category:
trident-kubernetes
Specialty:
snapx
Last Updated:

環境

  • NetApp Trident CSIドライバー(対応バージョンすべて)
  • Kubernetes(K3s、OpenShift、およびその他のサポートされているディストリビューションを含む)
  • fsType ext4またはXFSを使用してTridentでプロビジョニングされた永続ボリューム

回答

Trident CSI による自動ファイルシステムサイズ変更:

Trident によってバックアップされた Kubernetes PV のサイズを拡張する必要がある場合(ext4 または XFS を使用)、Trident CSI ドライバーは CSI ボリューム拡張ワークフローの一部としてプロセスを完全に自動化します。以下のベストプラクティスが適用されます:

  1. StorageClassの構成:
    StorageClassに allowVolumeExpansion: true が設定されていることを確認してください。例:

    apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: ontap-san provisioner: csi.trident.netapp.io parameters: backendType: "ontap-san" fsType: "xfs" # or "ext4" allowVolumeExpansion: true
  2. PVC は再マウントが必要:
    サイズ変更要求時には、PVC は使用中(稼働中の Pod にマウントされている状態)である必要があります。

  3. サイズ変更ワークフロー:
    PVCを編集して要求されたストレージサイズを増やすと、Tridentは以下の処理を自動的に実行します。

    • ONTAP 上の LUN/名前空間を拡張します。
    • ワーカーノード上のブロックデバイスを再スキャンします。
    • マウントされたファイルシステム上で xfs_growfs (XFS の場合)または resize2fs (ext4 の場合)を実行します。

    PVCが実行中のポッドに接続されている限り、手動操作やポッドの再起動は不要です。 

    関連するログ出力:
    Tridentコントローラーのログには、次のようなエントリが表示されます:
    Expanding volume ...
    Filesystem resize successful for device /dev/sdX using xfs_growfs
    または
    Filesystem resize successful for device /dev/sdX using resize2fs

  4. 参照:

追加情報

サイズ変更のリクエスト時にPVCがマウントされていない場合、Tridentはファイルシステムを拡張できません(ブロックデバイスのみサイズ変更されます)。ファイルシステムのサイズ変更を完了するには:

  • PVCを実行中のPodに接続して再マウントします。Tridentは保留中のサイズ変更を検知し、ファイルシステムの拡張を自動的に実行します。

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.