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
-
Add the MinIO Helm Repository
helm repo add minio https://helm.min.io/ helm repo update helm search repo minio -
Install the
minio/directpvcharthelm install directpv minio/directpvFor custom options such as
nodeSelectorsortolerations, see Advanced installation options. -
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-iowhen constructing the Persistent Volume Claim.
Install the DirectPV plugin
The plugin provides command line tools to manage your DirectPV installation.
-
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-directpvbinary. The plugin is available foramd64,arm64, andppc64learchitectures.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. -
Mark the downloaded plugin as executable.
chmod a+x /usr/local/bin/kubectl-directpvExecutables on macOSmacOS typically blocks unsigned binaries from running. If thekubectl-directpvcommand fails, go to System Settings, then Privacy and Security. Scroll to the Security section and select Allow Anyway for thekubectl-directpvapplication.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.
-
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 -
Edit the
directpv-values.yamlfile.For example, to edit the file with the CLI text editor
nano:nano directpv-values.yamlThe example manifest below includes the
nodeserverkey for controlling how DirectPV determines eligible nodes. SetnodeSelectorto limit DirectPV to specific nodes in the cluster. Settolerationsto 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" ] -
Install the chart using the custom values.
helm install directpv minio/directpv \ -f directpv-values.yamlIf successful, the command outputs a summary of installed resources.
-
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.