DirectPV Upgrade - cniackz/public GitHub Wiki

Objective:

To document DirectPV Upgrade Process from v4.0.5 to v4.0.10

Links:

Steps:

  1. Install old directpv version v4.0.5:
$ ./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
$ ./directpv --version
directpv version v4.0.5
$ oc get serviceaccount -n directpv
NAME              SECRETS   AGE
builder           1         102s
default           1         102s
deployer          1         102s
directpv-min-io   1         102s
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
$ ./directpv info
┌──────┬──────────┬───────────┬─────────┬────────┐
│ NODE │ CAPACITY │ ALLOCATED │ VOLUMES │ DRIVES │
├──────┼──────────┼───────────┼─────────┼────────┤
│ • 25 │ 8.1 TiB  │ 0 B       │ 0       │ 7      │
│ • 26 │ 9.1 TiB  │ 0 B       │ 0       │ 7      │
│ • 27 │ 9.6 TiB  │ 0 B       │ 0       │ 8      │
└──────┴──────────┴───────────┴─────────┴────────┘

0 B/27 TiB used, 0 volumes, 22 drives
  1. Deploy MinIO via Operator and get some volumes from DirectPV
$ oc get pvc -n tenant-lite
NAME                     STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS      AGE
data0-myminio-pool-0-0   Bound    pvc-5323a38e-301f-4935-b16d-11d6d2fe2b5d   2Gi        RWO            directpv-min-io   61s
data0-myminio-pool-0-1   Bound    pvc-9f531367-daa7-4485-9807-065cb3f054d3   2Gi        RWO            directpv-min-io   53s
data0-myminio-pool-0-2   Bound    pvc-bc4f3663-3a77-477d-8916-0500b8ac7121   2Gi        RWO            directpv-min-io   42s
data1-myminio-pool-0-0   Bound    pvc-3d133806-8fcf-45a5-9901-66994b13ce2d   2Gi        RWO            directpv-min-io   53s
data1-myminio-pool-0-1   Bound    pvc-b3bc654d-23af-469c-a6bc-fd0d80054328   2Gi        RWO            directpv-min-io   41s
data1-myminio-pool-0-2   Bound    pvc-e3c28d19-d63b-4d3e-9137-7efd4eb0f3c6   2Gi        RWO            directpv-min-io   66s
  1. Now get latest DirectPV binary v4.0.10:
$ ./kubectl-directpv_4.0.10_darwin_arm64 info
┌──────┬──────────┬───────────┬─────────┬────────┐
│ NODE │ CAPACITY │ ALLOCATED │ VOLUMES │ DRIVES │
├──────┼──────────┼───────────┼─────────┼────────┤
│ • 25 │ 8.1 TiB  │ 4.0 GiB   │ 2       │ 7      │
│ • 26 │ 9.1 TiB  │ 4.0 GiB   │ 2       │ 7      │
│ • 27 │ 9.6 TiB  │ 4.0 GiB   │ 2       │ 8      │
└──────┴──────────┴───────────┴─────────┴────────┘

12 GiB/27 TiB used, 6 volumes, 22 drives
  1. Uninstall old version with new binary:
$ ./kubectl-directpv_4.0.10_darwin_arm64 uninstall
DirectPV uninstalled successfully
  1. Install new version with new binary:
$ ./kubectl-directpv_4.0.10_darwin_arm64 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
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
$ ./kubectl-directpv_4.0.10_darwin_arm64 info
┌──────┬──────────┬───────────┬─────────┬────────┐
│ NODE │ CAPACITY │ ALLOCATED │ VOLUMES │ DRIVES │
├──────┼──────────┼───────────┼─────────┼────────┤
│ • 25 │ 8.1 TiB  │ 4.0 GiB   │ 2       │ 7      │
│ • 26 │ 9.1 TiB  │ 4.0 GiB   │ 2       │ 7      │
│ • 27 │ 9.6 TiB  │ 4.0 GiB   │ 2       │ 8      │
└──────┴──────────┴───────────┴─────────┴────────┘

12 GiB/27 TiB used, 6 volumes, 22 drives
  1. Verify image in directpv pods:
image: 'quay.io/minio/directpv:v4.0.10'
  1. Notice MinIO Pods are not affected, still running as normal:
$ k get pods -n tenant-lite
NAME               READY   STATUS    RESTARTS   AGE
myminio-pool-0-0   2/2     Running   0          10m
myminio-pool-0-1   2/2     Running   0          10m
myminio-pool-0-2   2/2     Running   0          10m
  1. New DirectPV recognizes the old volumes:
$ ./kubectl-directpv_4.0.10_darwin_arm64 info
┌──────┬──────────┬───────────┬─────────┬────────┐
│ NODE │ CAPACITY │ ALLOCATED │ VOLUMES │ DRIVES │
├──────┼──────────┼───────────┼─────────┼────────┤
│ • 25 │ 8.1 TiB  │ 4.0 GiB   │ 2       │ 7      │
│ • 26 │ 9.1 TiB  │ 4.0 GiB   │ 2       │ 7      │
│ • 27 │ 9.6 TiB  │ 4.0 GiB   │ 2       │ 8      │
└──────┴──────────┴───────────┴─────────┴────────┘

12 GiB/27 TiB used, 6 volumes, 22 drives