Skip to content

directpv installation

Allan Roger Reid edited this page Nov 8, 2024 · 1 revision

See steps at https://github.com/minio/directpv/blob/master/docs/installation.md

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64
minikube stop
minikube start
eval $(minikube docker-env)
alias k="minikube kubectl --"
😄  minikube v1.34.0 on Ubuntu 22.04
✨  Using the docker driver based on existing profile
👍  Starting "minikube" primary control-plane node in "minikube" cluster
🚜  Pulling base image v0.0.45 ...
🔄  Restarting existing docker container for "minikube" ...
🐳  Preparing Kubernetes v1.31.0 on Docker 27.2.0 ...
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: default-storageclass, storage-provisioner

❗  /usr/local/bin/kubectl is version 1.28.3, which may have incompatibilities with Kubernetes 1.31.0.
    ▪ Want kubectl v1.31.0? Try 'minikube kubectl -- get pods -A'
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
# Update the plugin list.
kubectl krew update
# Install DirectPV plugin.
kubectl krew install directpv
Updated the local copy of plugin index.
Updated the local copy of plugin index.
Installing plugin: directpv
W1108 02:52:13.093964  563292 install.go:160] Skipping plugin "directpv", it is already installed
# 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
kubectl directpv install
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 40.4M  100 40.4M    0     0  25.8M      0  0:00:01  0:00:01 --:--:-- 74.6M
Installing on unsupported Kubernetes v1.31

 ███████████████████████████████████████████████████████████████████████████ 100%

┌──────────────────────────────────────┬──────────────────────────┐
│ NAME                                 │ KIND                     │
├──────────────────────────────────────┼──────────────────────────┤
│ directpv                             │ Namespace                │
│ directpv-min-io                      │ ServiceAccount           │
│ directpv-min-io                      │ ClusterRole              │
│ directpv-min-io                      │ ClusterRoleBinding       │
│ directpv-min-io                      │ Role                     │
│ directpv-min-io                      │ RoleBinding              │
│ directpvdrives.directpv.min.io       │ CustomResourceDefinition │
│ directpvvolumes.directpv.min.io      │ CustomResourceDefinition │
│ directpvnodes.directpv.min.io        │ CustomResourceDefinition │
│ directpvinitrequests.directpv.min.io │ CustomResourceDefinition │
│ directpv-min-io                      │ CSIDriver                │
│ directpv-min-io                      │ StorageClass             │
│ node-server                          │ Daemonset                │
│ controller                           │ Deployment               │
└──────────────────────────────────────┴──────────────────────────┘

DirectPV installed successfully
# Probe and save drive information to drives.yaml file.
kubectl directpv discover
 Discovering node 'minikube' ●∙∙

ERROR discovery failed; unable to complete the discovery; context deadline exceeded

Debug

allan@wingzero:~$ k get nodes
NAME       STATUS   ROLES           AGE    VERSION
minikube   Ready    control-plane   164m   v1.31.0
allan@wingzero:~$ k -n directpv get pods
NAME                          READY   STATUS             RESTARTS         AGE
controller-5d898498d4-4nsws   3/3     Running            10 (7m39s ago)   156m
controller-5d898498d4-59gxb   3/3     Running            10 (7m43s ago)   156m
controller-5d898498d4-n5crx   3/3     Running            10 (7m45s ago)   156m
node-server-9pm8t             3/4     CrashLoopBackOff   46 (2m45s ago)   156m
allan@wingzero:~$ k -n directpv logs node-server-9pm8t 
Defaulted container "node-driver-registrar" out of: node-driver-registrar, node-server, node-controller, liveness-probe
I1108 02:51:33.762762    4551 main.go:150] "Version" version="unknown"
I1108 02:51:33.762800    4551 main.go:151] "Running node-driver-registrar" mode=""
I1108 02:51:33.762814    4551 main.go:172] "Attempting to open a gRPC connection" csiAddress="unix:///csi/csi.sock"
I1108 02:51:34.764601    4551 main.go:180] "Calling CSI driver to discover driver name"
I1108 02:51:34.772290    4551 main.go:189] "CSI driver name" csiDriverName="directpv-min-io"
I1108 02:51:34.772406    4551 node_register.go:56] "Starting Registration Server" socketPath="/registration/directpv-min-io-reg.sock"
I1108 02:51:34.773013    4551 node_register.go:66] "Registration Server started" socketPath="/registration/directpv-min-io-reg.sock"
I1108 02:51:34.773866    4551 node_register.go:96] "Skipping HTTP server"
I1108 02:51:34.895875    4551 main.go:96] "Received GetInfo call" request="&InfoRequest{}"
I1108 02:51:34.922334    4551 main.go:108] "Received NotifyRegistrationStatus call" status="&RegistrationStatus{PluginRegistered:true,Error:,}"
Clone this wiki locally