Skip to content

How to install directpv in added nodes

Cesar Celis Hernandez edited this page Apr 13, 2023 · 4 revisions

Objective:

To show/provide a demo on how you can install DirectPV in new added nodes to an existing cluster.

Steps:

  1. Please read all documentation on how to upgrade DirectPV if not in the latest version:
  1. Once the documentation has been read, please proceed and upgrade accordingly.
  • For this demo, initial version was:
minio@minio-k8s17:~$ kubectl directpv --version
directpv version v3.2.0
  • We uninstall it:
kubectl directpv uninstall

Expected:

minio@minio-k8s17:~$ kubectl directpv uninstall
I0413 15:07:00.092622 2844108 deployment.go:302] 'direct.csi.min.io' controller deployment deleted
I0413 15:07:00.098556 2844108 daemonset.go:53] 'direct.csi.min.io' daemonset deleted
I0413 15:07:00.110232 2844108 service.go:47] 'direct.csi.min.io' service deleted
I0413 15:07:00.113472 2844108 validationrules.go:155] 'direct.csi.min.io' validation rules removed
I0413 15:07:01.184327 2844108 storageclass.go:60] 'direct.csi.min.io' storageclass deleted
I0413 15:07:01.967597 2844108 csidriver.go:158] 'direct.csi.min.io' csidriver deleted
I0413 15:07:01.974746 2844108 conversion_secret.go:42] 'direct.csi.min.io' conversion secrets deleted
W0413 15:07:01.987550 2844108 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
I0413 15:07:01.987604 2844108 psp.go:163] 'direct.csi.min.io' pod security policy removed
I0413 15:07:02.052471 2844108 rbac.go:377] 'direct.csi.min.io' rbac roles deleted
I0413 15:07:02.066227 2844108 ns.go:82] 'direct.csi.min.io' namespace deleted
  • We make sure no remaining pod is still present in the cluster.

  • Uninstalled the plugin:

minio@minio-k8s17:~$ kubectl krew uninstall directpv
Uninstalled plugin: directpv
  • Then re-installed the plugin:
minio@minio-k8s17:~$ kubectl krew install directpv
Updated the local copy of plugin index.
Installing plugin: directpv
Installed plugin: directpv
\
 | Use this plugin:
 | 	kubectl directpv
 | Documentation:
 | 	https://github.com/minio/directpv
/
WARNING: You installed plugin "directpv" from the krew-index plugin repository.
   These plugins are not audited for security by the Krew maintainers.
   Run them at your own risk.
  • Labeled the nodes to show how you can select the nodes where DirectPV will run:
kubectl label nodes minio-k8s17 directpv=yes
kubectl label nodes minio-k8s18 directpv=yes
kubectl label nodes minio-k8s19 directpv=yes
kubectl label nodes minio-k8s20 directpv=yes
  • Finally the installation is made against those nodes:
minio@minio-k8s17:~$ kubectl directpv install --node-selector directpv=yes

 ███████████████████████████████████████████████████████████████████████████ 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              │
│ directpv-min-io                      │ PodSecurityPolicy        │
│ psp-directpv-min-io                  │ ClusterRoleBinding       │
│ directpvdrives.directpv.min.io       │ CustomResourceDefinition │
│ directpvvolumes.directpv.min.io      │ CustomResourceDefinition │
│ directpvnodes.directpv.min.io        │ CustomResourceDefinition │
│ directpvinitrequests.directpv.min.io │ CustomResourceDefinition │
│ directpv-min-io                      │ CSIDriver                │
│ direct-csi-min-io                    │ CSIDriver                │
│ directpv-min-io                      │ StorageClass             │
│ direct-csi-min-io                    │ StorageClass             │
│ node-server                          │ Daemonset                │
│ legacy-node-server                   │ Daemonset                │
│ controller                           │ Deployment               │
│ legacy-controller                    │ Deployment               │
└──────────────────────────────────────┴──────────────────────────┘

DirectPV installed successfully
  • Version is now:
minio@minio-k8s17:~$ kubectl directpv --version
directpv version v4.0.3
Clone this wiki locally