Skip to content

How to install DirectPV in local OpenShift

Cesar Celis Hernandez edited this page Oct 2, 2023 · 3 revisions

Objective:

To document how DirectPV can be installed in local OpenShift and its current issues.

Steps:

  1. Get CRC Running with OpenShift.

  2. Install OpenShift:

$ kubectl directpv install

 ███████████████████████████████████████████████████████████████████████████ 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
  1. Give permissions to the accounts:
oc adm policy add-scc-to-user privileged -n directpv -z builder
oc adm policy add-scc-to-user privileged -n directpv -z default
oc adm policy add-scc-to-user privileged -n directpv -z deployer
oc adm policy add-scc-to-user privileged -n directpv -z directpv-min-io
  1. Reduced replicas to 1 for single node scenario.

  2. Check on the info:

$ kubectl directpv info
┌──────────────────────┬──────────┬───────────┬─────────┬────────┐
│ NODE                 │ CAPACITY │ ALLOCATED │ VOLUMES │ DRIVES │
├──────────────────────┼──────────┼───────────┼─────────┼────────┤
│ • crc-87z92-master-0 │ -        │ -         │ -       │ -      │
└──────────────────────┴──────────┴───────────┴─────────┴────────┘
  1. Discover Drives:
$ kubectl directpv discover

 Discovered node 'crc-87z92-master-0' ✔

No drives are available to initialize

Current problem the VM has only one used disk:

sh-4.4# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0    7:0    0   16M  0 loop 
vda    252:0    0   31G  0 disk 
|-vda1 252:1    0    1M  0 part 
|-vda2 252:2    0  127M  0 part 
|-vda3 252:3    0  384M  0 part /host/boot
`-vda4 252:4    0 30.5G  0 part /host/sysroot
sh-4.4# 
Clone this wiki locally