Install DirectPV on Upstream Kubernetes

This page documents the installation and management of MinIO DirectPV on Kubernetes infrastructure using a distribution that follows the upstream API and functionality.

Prerequisites

Kubernetes release

MinIO recommends using an in-support, active release of Kubernetes. In general, Kubernetes releases remain supported for up to one year after release.

DirectPV requires Kubernetes release 1.29 or later.

Authorization

This procedure assumes that the user interacting with the Kubernetes cluster has authorization to:

  • Install Kubernetes operators and associated resources including CustomResourceDefinitions, StatefulSets, and Secrets into new or existing namespaces.
  • Perform operations as a user that has broad permissions to create resources within multiple namespaces.

Install DirectPV using Helm Charts

  1. Add the MinIO Helm Repository

    helm repo add minio https://helm.min.io/
    helm repo update
    helm search repo minio
    
  2. Install the minio/directpv chart

    helm install directpv minio/directpv
    

    For custom options such as nodeSelectors or tolerations, see Advanced installation options.

  3. Next Steps

    Once you have installed DirectPV, you can prepare drives for provisioning. You can then dynamically allocate storage to pods by specifying storageClass: directpv-min-io when constructing the Persistent Volume Claim.

Install the DirectPV plugin

The plugin provides command line tools to manage your DirectPV installation.

  1. Download the DirectPV plugin

    Open your browser and navigate to https://dl.min.io/aistor/directpv/release/. Select the folder for your operating system and architecture and download the kubectl-directpv binary. The plugin is available for amd64, arm64, and ppc64le architectures.

    Move the downloaded file to your system PATH. For example, move the file to /usr/local/bin/ or, for Windows, $HOME\bin\. Refer to the documentation for your operating system for where to place the file.

  2. Mark the downloaded plugin as executable.

    chmod a+x /usr/local/bin/kubectl-directpv
    
    Executables on macOS
    macOS typically blocks unsigned binaries from running. If the kubectl-directpv command fails, go to System Settings, then Privacy and Security. Scroll to the Security section and select Allow Anyway for the kubectl-directpv application.

    You can validate the command works by running kubectl directpv --help.

Advanced installation options

Custom chart values

You can customize the minio/directpv chart to limit node selections or add tolerations. These options are not required.

This chart contains the necessary Kubernetes resources for deploying MinIO DirectPV resources through the directpv chart.

  1. Create a YAML manifest for the chart named directpv-values.yaml.

    For example, to create the file from the command line:

    touch directpv-values.yaml
    
  2. Edit the directpv-values.yaml file.

    For example, to edit the file with the CLI text editor nano:

    nano directpv-values.yaml
    

    The example manifest below includes the nodeserver key for controlling how DirectPV determines eligible nodes. Set nodeSelector to limit DirectPV to specific nodes in the cluster. Set tolerations to allow DirectPV to ignore node taints.

    nodeserver:
      nodeSelector: {
      # aistor.min.io/pool-id: "1"
      }
      tolerations: [
      # - key: "node-role.kubernetes.io/control-plane"
      #   operator: "Exists"
      #   effect: "NoSchedule"
      ]
    
  3. Install the chart using the custom values.

    helm install directpv minio/directpv \
      -f directpv-values.yaml
    

    If successful, the command outputs a summary of installed resources.

  4. Validate the installation.

    Run the following command and check the status of deployed resources.

    kubectl get all -n directpv
    

seccomp

If seccomp is enabled, load the DirectPV seccomp profile on nodes where you want to install DirectPV. Then, include nodeserver.seccompLocalhostProfile in your customized Helm chart.

For example, in your directpv-values.yaml:

nodeserver:
  seccompLocalhostProfile: "profiles/seccomp.json"

For more information, refer to the Kubernetes documentation

apparmor

If apparmor is enabled, load DirectPV apparmor profile on nodes where you want to install DirectPV. Then, include nodeserver.podAnnotations in your customized Helm chart.

For more information, refer to the Kubernetes documentation.