Configuring Application Storage

A PersistentVolume (PV) is a component of the storage resources provided by the cluster. It signifies a provisioned segment of storage, administered by an administrator, and ready for utilization by the nodes within the cluster. Persistent Volumes can be shared among multiple pods and persist beyond the lifecycle of any individual pod.

To access Control Center logs, a PersistentVolume needs to be established. The Cluster Administrator will create this PersistentVolume for usage, and there are two methods to achieve this:
  1. Static PersistentVolume- For static PersistentVolume, Kubernetes PersistentVolume resource will be created. Following is the sample ibm-sccm-pv.yaml file of PersistentVolume with NFS :
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ibm-sccm-pv
      labels:
        app.kubernetes.io/name: ibm-scc-pv
        app.kubernetes.io/instance: ibm-sccm
        app.kubernetes.io/managed-by: ibm-sccm-service
        helm.sh/chart: ibm-sccm
        release: ibm-sccm
    spec:
      persistentVolumeReclaimPolicy: Retain
      storageClassName: manual
      capacity:
        storage: 20Gi # Storage capacity for this PV
      accessModes:
        - ReadWriteOnce
      nfs:
        server: 111.22.333.444
        path: /docker_volume/
        readOnly: false
    
    Now, create a Kubernetes PersistentVolume using following command:
    $ oc create -f ibm-sccm-pv.yaml

    To create a Persistent Volume, ensure you have one NFS-mounted directory per server, accessible from all worker nodes.

    Invoke the following command to verify if your Persistence Volume is created:
    $ oc get pv
  2. Dynamic Volume Provisioning- For Dynamic Volume Provisioning, you only need to set up a StorageClass. The Kubernetes PersistentVolume resource will be created automatically when needed.

Configuration for Accessing Application Resources

Configure sharing external resources like database driver jars and certificate files with the application pods using one of the following methods:
  1. PersistentVolume(s) for application resources.
  2. Creating wrapper image with resources.
  3. Setting up init container for resources.