If you have an IBM® Power environment and want to use a FlexVolume Driver, you must configure a FlexVolume Driver storage class.
The FlexVolume Driver can be used to manage the virtual components in your environments. Complete the following steps to configure the FlexVolume Driver storage class:
Create a new project where you are deploying your PowerVC FlexVolume Driver.
Accessing the OpenShift Container Platform URL.
Select Create Project.
Enter the Name, Display Name and Description.
Patch the project to clear the nodeSelector tag by entering the following command:
oc patch namespace powervc-fvd -p '{"metadata": {"annotations": {"openshift.io/node-selector": ""}}}'
Assign the cluster-admin role to the powervc-fvd project’s default service account by entering the following command:
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:powervc-fvd:default
Set the hostmount-anyuid source code control to the user root, or the user ID that was used to create the powervc-fvd project by entering the following command:
oc adm policy add-scc-to-user hostmount-anyuid system:serviceaccount:powervc-fvd:default
Set the hostmount-anyuid source code control to the user root by entering the following command:
oc adm policy add-scc-to-user hostmount-anyuid system:serviceaccount:powervc-fvd:default
Tip: You can also add the cluster-admin role to the user ID that was used to create the powervc-fvd project by entering the following command:
oc adm policy add-cluster-role-to-user cluster-admin my-rhel-icp-admin -n powervc-fvd
Replace my-rhel-icp-admin with the user ID that you want to have the role.
Import the PowerVC FlexVolume Driver template into the powervc-fvd project by completing the following steps:
In the OpenShift Container Platform UI, select Add to Project > Import YAML/JSON.
Select the file that contains your product template.
Select the Save template option.
Select Import.
After the template is imported, the PowerVC FlexVolume application appears in the Catalog list of the OpenShift Container Platform UI.
Create a secret with the PowerVC username and password.
Select the IBM PowerVC FlexVolume Driver icon in the Catalog.
Select Resources > Secret from the menu.
Add the secret name and the keys. The key names should be the username and password of your PowerVC instance. “OS_USERNAME” and “OS_PASSWORD”. The values are the username and password of PowerVC.
From the OpenShift Container Platform Catalog, deploy the PowerVC FlexVolume Driver application.
Open the PowerVC FlexVolume Driver application from the Catalog.
Enter the required values. Tips:
/etc/tls/pki/certs/powervc.crt file on the PowerVC server.Select Create to create the new template.
After the PowerVC FVD application deployment is complete, the details of the provisioner and driver pods are displayed on the project's overview page.
Verify that the storage class is available by entering the following command:
oc get scc
Create a persistent volume claim to determine if the storage class is consumed.
cat pvc.yaml
The following example shows a possible persistent volume claim that you can create:apiVersion: "v1"
kind: "PersistentVolumeClaim"
metadata:
name: "claim"
namespace: "kube-system"
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "2Gi"
kubectl create -f pvc.yaml
kubectl get pvc -n kube-system