DirectPV comes with two components:
The plugin needs to be installed to manage DirectPV CSI driver in Kubernetes.
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
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
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.
seccomp
is enabled, load DirectPV seccomp profile on nodes where you want to install DirectPV and use --seccomp-profile
flag to kubectl directpv install
command. For more information, refer Kubernetes documentation hereapparmor
is enabled, load DirectPV apparmor profile on nodes where you want to install DirectPV and use --apparmor-profile
flag to kubectl directpv install
command. For more information, refer to the Kubernetes documentation.ExpandCSIVolumes
feature gate for volume expansion feature.To install DirectPV in all Kubernetes nodes, run
$ kubectl directpv install
To install DirectPV on selected Kubernetes nodes and/or with tolerations and/or with non-standard kubelet
directory, use below steps accordingly.
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
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
kubelet
directoryTo 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
To install DirectPV on Openshift with specific configuration, use the --openshift
flag. Below is an example:
$ kubectl directpv install --openshift
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