Creating the persistent volume claims (PVC) using storage classes

This task provides the procedure for automatically creating the two folders, two persistent volumes (PV) (for the instance and logstore) and two persistent volume claims (PVC) using storage classes.

Before you begin

You must first create the storage classes. See the following example for more details OpenShift dynamic NFS persistent volume using NFS-client-provisioner.

Procedure

  1. PVC for the Content Collector for SAP Applications instance volume:
    1. Create a file for configuring the persistent volume claim, iccsap-instance-pvc.
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: iccsap-instance-pvc
        namespace: <NAMESPACE>
      spec:
        accessModes:
        - ReadWriteMany
         resources:
           requests:
             storage: 1Gi
         volumeName: iccsap-instance-pv
    2. Run the following commands to apply the newly created PVC:
      kubectl apply -f iccsap-instance-pvc.yaml
  2. PVC for the Content Collector for SAP Applications logstore volume:
    1. Create a file for configuring the persistent volume claim, iccsap-logstore-pv.
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        name: iccsap-logstore-pvc
        namespace: <NAMESPACE>
      spec:
        accessModes:
        - ReadWriteMany
         resources:
           requests:
             storage: 1Gi
         volumeName: iccsap-logstore-pv
    2. Run the following commands to apply the newly created PVC:
      kubectl apply -f iccsap-logstore-pvc.yaml
  3. Set the following owner and permission for the folders that are mounted as persistent volumes:
    chown -Rf 50001:0 /var
    chmod -Rf g=u /var