NTNX>日記

個人的な趣味による Nutanix Community Edition 日記。Japanese のみですみません。

NKP クラスタで Nutanix CSI Driver をバージョンアップしてみる。(検証むけ)

Nutanix Kubernetes Platform(NKP)クラスタで、CSI Driver をアップデートしてみます。

今回の内容です。

 

今回の環境

NKP クラスタの CSI Driver は、通常は NKP のアップデートに含まれます。今回は、ためしに NKP のバージョンは変更せずに、CSI Driver のみアップデートしてみました。

今回は、NKP v2.16.0 のワークロード クラスタを使用しています。

$ kubectl get nodes
NAME                            STATUS   ROLES           AGE   VERSION
nkpw04-5ghft-7rn92              Ready    control-plane   13m   v1.33.2
nkpw04-md-0-wjf8p-csn6j-hcm5p   Ready    <none>          11m   v1.33.2

 

NKP v2.16.0 のクラスタには、Nutanix CSI Driver 3.3.4 がインストールされています。

$ helm list -n ntnx-system | grep  nutanix-csi
nutanix-csi     ntnx-system     1               2025-12-08 12:00:22.086536345 +0000 UTC deployed        nutanix-csi-storage-3.3.4       3.3.4

 

今回は、このクラスタに Nutanix Data Services for Kubernetes(NDK)2.0 をインストールしたかったので、手動で Nutanix CSI Driver 3.3.9(NDK 2.0 の要件は 3.3.8 以上)にアップデートしてみます。

 

Nutanix の Helm Repo は下記のように追加してあります。

$ helm repo add ntnx-charts https://nutanix.github.io/helm-releases/

 

Nutanix CSI Driver は、3.3.9 が公開されています。

$ helm search repo ntnx-charts/nutanix-csi-storage
NAME                            CHART VERSION   APP VERSION     DESCRIPTION
ntnx-charts/nutanix-csi-storage 3.3.9           3.3.9           Nutanix Container Storage Interface (CSI) Driver

 

ワークロード クラスタ:手動での helm upgrade(失敗)

NKP クラスタでは、アプリが Helm で管理されています。しかし実際には、Cluster APIのClusterClass や HelmChatProxy といった上位の Kubernetes リソースで管理されているため、手動で helm upgrade を実行しても、少し待つとロールバックされてしまいます。

ためしに helm upgrade を実行してみます。

$ helm upgrade nutanix-csi ntnx-charts/nutanix-csi-storage \
-n ntnx-system \
--version 3.3.9 \
-f nutanix-csi_values.yml \
--install
Release "nutanix-csi" has been upgraded. Happy Helming!
NAME: nutanix-csi
LAST DEPLOYED: Mon Dec  8 15:45:37 2025
NAMESPACE: ntnx-system
STATUS: deployed
REVISION: 4
TEST SUITE: None
NOTES:
Driver name: csi.nutanix.com
fsGroupPolicy: File
NOTE: fsGroupPolicy is set to 'File'. This value is immutable after installation. To change it, delete the CSIDriver, modify the helm chart by adding desired fsGroupPolicy value and reinstall the csi driver.

Nutanix CSI provider was deployed in namespace ntnx-system. Check it's status by running:
kubectl -n ntnx-system get pods | grep 'nutanix-csi'

 

このとき、一時的に CSI Driver は v3.3.9 にバージョンアップされます。

$ kubectl get csidrivers.storage.k8s.io csi.nutanix.com --show-labels
NAME              ATTACHREQUIRED   PODINFOONMOUNT   STORAGECAPACITY   TOKENREQUESTS   REQUIRESREPUBLISH   MODES        AGE     LABELS
csi.nutanix.com   true             true             false             <unset>         false               Persistent   2m19s   app.kubernetes.io/instance=nutanix-csi,app.kubernetes.io/managed-by=Helm,app.kubernetes.io/management-plane=PrismCentral,app.kubernetes.io/name=nutanix-csi-storage,app.kubernetes.io/version=3.3.9,helm.sh/chart=nutanix-csi-storage-3.3.9
$ kubectl get csidrivers.storage.k8s.io csi.nutanix.com -o json | jq -r .metadata.labels
{
  "app.kubernetes.io/instance": "nutanix-csi",
  "app.kubernetes.io/managed-by": "Helm",
  "app.kubernetes.io/management-plane": "PrismCentral",
  "app.kubernetes.io/name": "nutanix-csi-storage",
  "app.kubernetes.io/version": "3.3.9",
  "helm.sh/chart": "nutanix-csi-storage-3.3.9"
}

 

しかし、少し待つと自動的に v3.3.4 にロールバックされてしまいます。(バージョンを確認しやすい label のみ表示しています。)

$ kubectl get csidrivers.storage.k8s.io csi.nutanix.com -o json | jq -r .metadata.labels
{
  "app.kubernetes.io/instance": "nutanix-csi",
  "app.kubernetes.io/managed-by": "Helm",
  "app.kubernetes.io/management-plane": "PrismCentral",
  "app.kubernetes.io/name": "nutanix-csi-storage",
  "app.kubernetes.io/version": "3.3.4",
  "helm.sh/chart": "nutanix-csi-storage-3.3.4"
}

 

1. 管理クラスタ:HelmChartProxy リソースの確認

NKP では、Cluster API のアドオンである、HelmChartProxy(helmchartproxies.addons.cluster.x-k8s.io)リソースで、アプリのバージョンを管理しているようです。

今回は NKP のワークロード クラスタ(nkpw04)の CSI Driver をバージョンアップするので、NKP の管理クラスタで、CSI Driver の HelmChartProxy リソースを探します。nutanix-csi-storage-nkpw04-5hkfp

$ kubectl get helmreleaseproxy -A | grep csi
default     nutanix-csi-storage-nkpm01-z8wdf      nkpm01    True             deployed   1
ws-01       nutanix-csi-storage-nkpw04-5hkfp      nkpw04    True             deployed   9

 

nkpw04 の nutanix-csi-storage Chart のバージョンは「3.3.4」が指定されています。

$ kubectl get helmchartproxies.addons.cluster.x-k8s.io -n ws-01 nutanix-csi-019afdd3-e387-724a-9aec-ae4923ff1b77 -o json | jq -r .spec
{
  "chartName": "nutanix-csi-storage",
  "clusterSelector": {
    "matchLabels": {
      "cluster.x-k8s.io/cluster-name": "nkpw04"
    }
  },
  "namespace": "ntnx-system",
  "options": {
    "enableClientCache": false,
    "install": {
      "createNamespace": true
    },
    "timeout": "10m0s",
    "upgrade": {
      "maxHistory": 10
    }
  },
  "releaseName": "nutanix-csi",
  "repoURL": "oci://helm-repository.caren-system.svc/charts",
  "tlsConfig": {
    "caSecret": {
      "name": "helm-repository-tls",
      "namespace": "caren-system"
    }
  },
  "valuesTemplate": "# Disable creating the Prism Central credentials Secret, the Secret will be created by the handler.\ncreatePrismCentralSecret: false\n# Disable creating the Prism Element credentials Secret, it won't be used the CSI driver as configured here.\ncreateSecret: false\npcSecretName: nutanix-csi-credentials\n\ntolerations:\n  - key: CriticalAddonsOnly\n    operator: Exists\n  - effect: NoExecute\n    operator: Exists\n    tolerationSeconds: 300\n  - effect: NoSchedule\n    operator: Exists",
  "version": "3.3.4"
}

 

.spec.version のみ取得してみました。ちなみに、関連リソースである HelmReleaseProxies も自動的に更新されます。よく見ると、repoURL が oci://helm-repository.caren-system.svc/charts(NKP クラスタ内部のアドレス) となっているので v3.3.9 の Chart は取得できません。

$ kubectl get helmchartproxies.addons.cluster.x-k8s.io -n ws-01 nutanix-csi-019afdd3-e387-724a-9aec-ae4923ff1b77 -o json | jq -r .spec.version
3.3.4

 

2. 管理クラスタ:HelmChartProxy の編集によるアップデート

Nutanix CSI Driver のバージョンをアップデートするため、kubectl patch でリソース定義を変更します。/spec/version(.spec.version)を、v3.3.9 に置き換えるパッチを適用します。

kubectl -n ws-01 patch helmchartproxy nutanix-csi-019afdd3-e387-724a-9aec-ae4923ff1b77 \
--type=json \
-p='[{"op":"replace","path":"/spec/version","value":"3.3.9"}]'

 

これで、HelmChartProxy でのバージョン指定が v3.3.9 に変更されました。

$ kubectl get helmchartproxies.addons.cluster.x-k8s.io -n ws-01 nutanix-csi-019afdd3-e387-724a-9aec-ae4923ff1b77 -o json | jq -r .spec
{
  "chartName": "nutanix-csi-storage",
  "clusterSelector": {
    "matchLabels": {
      "cluster.x-k8s.io/cluster-name": "nkpw04"
    }
  },
  "namespace": "ntnx-system",
  "options": {
    "enableClientCache": false,
    "install": {
      "createNamespace": true
    },
    "timeout": "10m0s",
    "upgrade": {
      "maxHistory": 10
    }
  },
  "releaseName": "nutanix-csi",
  "repoURL": "oci://helm-repository.caren-system.svc/charts",
  "tlsConfig": {
    "caSecret": {
      "name": "helm-repository-tls",
      "namespace": "caren-system"
    }
  },
  "valuesTemplate": "# Disable creating the Prism Central credentials Secret, the Secret will be created by the handler.\ncreatePrismCentralSecret: false\n# Disable creating the Prism Element credentials Secret, it won't be used the CSI driver as configured here.\ncreateSecret: false\npcSecretName: nutanix-csi-credentials\n\ntolerations:\n  - key: CriticalAddonsOnly\n    operator: Exists\n  - effect: NoExecute\n    operator: Exists\n    tolerationSeconds: 300\n  - effect: NoSchedule\n    operator: Exists",
  "version": "3.3.9"
}

 

そこで、今回は repoURLインターネットの Nutainx Repo に変更します。

kubectl -n ws-01 patch helmchartproxy nutanix-csi-019afdd3-e387-724a-9aec-ae4923ff1b77 \
--type=json \
-p='[{"op":"replace","path":"/spec/repoURL","value":"https://nutanix.github.io/helm-releases"}]'

 

これで、repoURL も変更されました。

$ kubectl get helmchartproxies.addons.cluster.x-k8s.io -n ws-01 nutanix-csi-019afdd3-e387-724a-9aec-ae4923ff1b77 -o json | jq -r .spec
{
  "chartName": "nutanix-csi-storage",
  "clusterSelector": {
    "matchLabels": {
      "cluster.x-k8s.io/cluster-name": "nkpw04"
    }
  },
  "namespace": "ntnx-system",
  "options": {
    "enableClientCache": false,
    "install": {
      "createNamespace": true
    },
    "timeout": "10m0s",
    "upgrade": {
      "maxHistory": 10
    }
  },
  "releaseName": "nutanix-csi",
  "repoURL": "https://nutanix.github.io/helm-releases",
  "tlsConfig": {
    "caSecret": {
      "name": "helm-repository-tls",
      "namespace": "caren-system"
    }
  },
  "valuesTemplate": "# Disable creating the Prism Central credentials Secret, the Secret will be created by the handler.\ncreatePrismCentralSecret: false\n# Disable creating the Prism Element credentials Secret, it won't be used the CSI driver as configured here.\ncreateSecret: false\npcSecretName: nutanix-csi-credentials\n\ntolerations:\n  - key: CriticalAddonsOnly\n    operator: Exists\n  - effect: NoExecute\n    operator: Exists\n    tolerationSeconds: 300\n  - effect: NoSchedule\n    operator: Exists",
  "version": "3.3.9"
}

HelmReleaseProxy リソースも、自動更新されます。

$ kubectl get helmreleaseproxies.addons.cluster.x-k8s.io -n ws-01 nutanix-csi-storage-nkpw04-9hg9f -o json | jq -r .spec
{
  "chartName": "nutanix-csi-storage",
  "clusterRef": {
    "apiVersion": "cluster.x-k8s.io/v1beta1",
    "kind": "Cluster",
    "name": "nkpw04",
    "namespace": "ws-01"
  },
  "namespace": "ntnx-system",
  "options": {
    "enableClientCache": false,
    "install": {
      "createNamespace": true
    },
    "timeout": "10m0s",
    "upgrade": {
      "maxHistory": 10
    }
  },
  "releaseName": "nutanix-csi",
  "repoURL": "https://nutanix.github.io/helm-releases",
  "tlsConfig": {
    "caSecret": {
      "name": "helm-repository-tls",
      "namespace": "caren-system"
    }
  },
  "values": "# Disable creating the Prism Central credentials Secret, the Secret will be created by the handler.\ncreatePrismCentralSecret: false\n# Disable creating the Prism Element credentials Secret, it won't be used the CSI driver as configured here.\ncreateSecret: false\npcSecretName: nutanix-csi-credentials\n\ntolerations:\n  - key: CriticalAddonsOnly\n    operator: Exists\n  - effect: NoExecute\n    operator: Exists\n    tolerationSeconds: 300\n  - effect: NoSchedule\n    operator: Exists",
  "version": "3.3.9"
}

 

3. ワークロード クラスタ:Nutanix CSI Driver のバージョン確認

管理クラスタ側の HelmChartProxy を更新することで、ワークロード クラスタ側の CSI Driver が自動的に v.3.3.9 にアップデートされます。

$ kubectl get csidrivers.storage.k8s.io csi.nutanix.com -o yaml
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
  annotations:
    meta.helm.sh/release-name: nutanix-csi
    meta.helm.sh/release-namespace: ntnx-system
  creationTimestamp: "2025-12-08T18:09:20Z"
  labels:
    app.kubernetes.io/instance: nutanix-csi
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/management-plane: PrismCentral
    app.kubernetes.io/name: nutanix-csi-storage
    app.kubernetes.io/version: 3.3.9
    helm.sh/chart: nutanix-csi-storage-3.3.9
  name: csi.nutanix.com
  resourceVersion: "225659"
  uid: d8cb996d-fd0f-4518-8e6d-dfb80ca23199
spec:
  attachRequired: true
  fsGroupPolicy: File
  podInfoOnMount: true
  requiresRepublish: false
  seLinuxMount: false
  storageCapacity: false
  volumeLifecycleModes:
  - Persistent

 

さいごに

なお、本来は HelmChartProxy の更新ではなく、NKP 自体をアップデートします。NKP v2.16.0 の Nutanix CSI Driver は v.3.3.4 でしたが、NKP v2.16.1 の Nutanix CSI Driver は v3.3.8 なので、NDK 2.0 に対応しています。

 

以上。

©2025 gowatana
クリエイティブ・コモンズ・ライセンスこの 作品 は クリエイティブ・コモンズ 表示 4.0 国際 ライセンスの下に提供されています。