directpv

Installation

DirectPV comes with two components:

  1. DirectPV plugin - installed on client machine.
  2. DirectPV CSI driver - installed on Kubernetes cluster.

DirectPV plugin installation

The plugin needs to be installed to manage DirectPV CSI driver in Kubernetes.

Prerequisites

Installation using Krew

The latest DirectPV plugin is available in Krew repository. Use below steps to install the plugin in your system.

# Update the plugin list.
$ kubectl krew update

# Install DirectPV plugin.
$ kubectl krew install directpv

Installation of release binary

The plugin binary name starts by kubectl-directpv and is available at https://github.com/minio/directpv/releases/latest. Download the binary as per your operating system and architecture. Below is an example for GNU/Linux on amd64 architecture:

# Download DirectPV plugin.
$ release=$(curl -sfL "https://api.github.com/repos/minio/directpv/releases/latest" | awk '/tag_name/ { print substr($2, 3, length($2)-4) }')
$ curl -fLo kubectl-directpv https://github.com/minio/directpv/releases/download/v${release}/kubectl-directpv_${release}_linux_amd64

# Make the binary executable.
$ chmod a+x kubectl-directpv

DirectPV CSI driver installation

Before starting the installation, it is required to have DirectPV plugin installed on your system. For plugin installation refer this documentation. If you are not using krew, replace kubectl directpv by kubectl-directpv in below steps.

Prerequisites

Default installation

To install DirectPV in all Kubernetes nodes, run

$ kubectl directpv install

Customized installation

To install DirectPV on selected Kubernetes nodes and/or with tolerations and/or with non-standard kubelet directory, use below steps accordingly.

Installing on selected nodes

To install DirectPV on selected nodes, use --node-selector flag to install command. Below is an example:

# Install DirectPV on nodes having label 'group-name' key and 'bigdata' value
$ kubectl directpv install --node-selector group-name=bigdata

Installing on tainted nodes

To install DirectPV on tainted nodes, use --toleration flag to install command. Below is an example:

# Install DirectPV on tainted nodes by tolerating 'key1' key, 'Equal' operator for 'value1' value with 'NoSchedule' effect
$ kubectl directpv install --tolerations key1=value1:NoSchedule

# Install DirectPV on tainted nodes by tolerating 'key2' key, 'Exists' operator with 'NoExecute' effect
$ kubectl directpv install --tolerations key2:NoExecute

Installing on non-standard kubelet directory

To install on non-standard kubelet directory, set the KUBELET_DIR_PATH environment variable and start the installation. Below is an example:

$ export KUBELET_DIR_PATH=/path/to/my/kubelet/dir
$ kubectl directpv install

Installing on Openshift

To install DirectPV on Openshift with specific configuration, use the --openshift flag. Below is an example:

$ kubectl directpv install --openshift

Installing by generating DirectPV manifests

To install using generated manifests file, run below command

$ curl -sfL https://github.com/minio/directpv/raw/master/docs/tools/install.sh | sh -s - apply

What’s next

Further reads