Configuring Storage Policies for NFS Datastores to Enable ReadWriteMany StorageClasses in vSphere Kubernetes Guest Cluster
search cancel

Configuring Storage Policies for NFS Datastores to Enable ReadWriteMany StorageClasses in vSphere Kubernetes Guest Cluster

book

Article ID: 429758

calendar_today

Updated On:

Products

Tanzu Kubernetes Runtime

Issue/Introduction

  • This article addresses the query on whether an additional VM Storage Policy is required to be created on vCenter Server when creating StorageClass with NFS backed datastore for ReadWriteMany persistent storage on vSphere Kubernetes Guest Cluster.
  • NFS datastores mounted on ESXi hosts are not automatically discovered by the vSphere Kubernetes Guest Cluster. 

Environment

VMware vSphere Kubernetes Service

Resolution

A tag-based Storage policy needs to be created to expose an NFS datastore as a StorageClass for vSphere Kubernetes Guest Cluster. 

  1. Create and Assign a Tag

    1. Log in to the vSphere Client.

    2. Navigate to Tags & Custom Attributes.

    3. Create a new Category (e.g., k8s-storage) ensuring it is assignable to Datastore.

    4. Create a new Tag (e.g., nfs-rwx) inside that category.

    5. Navigate to the Storage view, right-click the target NFS Datastore, and select Tags & Custom Attributes > Assign Tag.

    6. Select the nfs-rwx tag and confirm.

  2. Create the VM Storage Policy

    1. Navigate to Policies and Profiles > VM Storage Policies.

    2. Click Create.

    3. Enter a name (e.g., nfs-rwx-policy).

    4. On the Policy structure page, under "Datastore specific rules", select Enable tag-based placement rules.

    5. On the Tag based placement page:

      • Tag category: Select k8s-storage.

      • Usage: Select Use storage tagged with.

      • Tags: Browse and select nfs-rwx.

    6. On the Storage compatibility page, verify that the NFS datastore is listed as Compatible.

    7. Finish the wizard.

  3. Assign Policy to Namespace

    1. Navigate to Workload Management > Namespaces.

    2. Select the target Namespace.

    3. Under Storage, click Add Storage.

    4. Select the nfs-rwx-policy created above.

    5. (Optional) Set a storage limit for this policy.

Additional Information

Storage Concepts for VKS Clusters

Create a vSphere Storage Policy for VKS Clusters