Chapter 7. Gluster Block Storage as Backend for Logging and Metrics

Following section guides to configure Gluster Block Storage as the backend storage for logging and metrics

Note

Block volume expansion is now supported in OpenShift Container Storage 3.11. Refer to Section 3.2.3, “Block volume expansion”.

7.1. Prerequisites

Before setting gluster block storage as the backend for logging or metrics, check if the following prerequisites are met:

  • In the storageclass file, check if the default storage class is set to the storage class of gluster block. For example:

    # oc get storageclass
    NAME                TYPE
    gluster-block        gluster.org/glusterblock
  • If the default is not set to gluster-block (or any other name that you have provided) then execute the following command. For example:

    # oc patch storageclass gluster-block -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
    • Execute the following command to verify:

      oc get storageclass
      NAME                     TYPE
      gluster-block (default)   gluster.org/glusterblock

7.2. Enabling Gluster Block Storage as Backend for Logging

Follow the tasks mentioned below to enable Gluster Block Storage as backend for logging:

  1. To enable logging in Openshift Container platform, see https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html-single/configuring_clusters/#install-config-aggregate-logging
  2. The openshift_logging_es_pvc_dynamic ansible variable has to be set to true.

    [OSEv3:vars] openshift_logging_es_pvc_dynamic=true

    For example, a sample set of variables for openshift_logging_ are listed below.

    openshift_logging_install_logging=true
    openshift_logging_es_pvc_dynamic=true
    openshift_logging_kibana_nodeselector={"node-role.kubernetes.io/infra": "true"}
    openshift_logging_curator_nodeselector={"node-role.kubernetes.io/infra": "true"}
    openshift_logging_es_nodeselector={"node-role.kubernetes.io/infra": "true"}
    openshift_logging_es_pvc_size=10Gi
    openshift_logging_es_pvc_storage_class_name="glusterfs-registry-block"
  3. Run the Ansible playbook. For more information, see .https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html-single/configuring_clusters/#install-config-aggregate-logging
  4. To verify, execute the following command:

    # oc get pods -n openshift-logging

7.3. Enabling Gluster Block Storage as Backend for Metrics

Follow the tasks mentioned below to enable Gluster Block Storage as backend for metrics

Note

By default, since Container Native Storage performs three-way replication, data will be available to the restarted node from anywhere in the cluster. As a result, it is recommended that Cassandra-level replication is turned off to avoid capacity overhead

  1. To enable metrics in Openshift Container platform, see https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html-single/configuring_clusters/#install-config-cluster-metrics
  2. The openshift_metrics_cassandra_storage_type ansible variable should be set to dynamic:

    [OSEv3:vars]openshift_metrics_cassandra_storage_type=dynamic

    For example, a sample set of variables for openshift_metrics_ are listed below.

    openshift_metrics_install_metrics=true
    openshift_metrics_storage_kind=dynamic
    openshift_metrics_hawkular_nodeselector={"node-role.kubernetes.io/infra": "true"}
    openshift_metrics_cassandra_nodeselector={"node-role.kubernetes.io/infra": "true"}
    openshift_metrics_heapster_nodeselector={"node-role.kubernetes.io/infra": "true"}
    openshift_metrics_storage_volume_size=10Gi
    openshift_metrics_cassandra_pvc_storage_class_name="glusterfs-registry-block"
  3. Run the Ansible playbook. For more information, see https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html-single/configuring_clusters/#install-config-cluster-metrics.
  4. To verify, execute the following command:

    # oc get pods --namespace openshift-infra

    It should list the following pods running:

    heapster-cassandra
    heapster-metrics
    hawkular-&*9

7.4. Verifying if Gluster Block is Setup as Backend

Execute the following commands to verify if gluster block is setup as the backend for logging and metrics:

  1. To get an overview of the infrastructure, execute the following command:

    # oc get pods -n logging -o jsonpath='{range .items[].status.containerStatuses[]}{"Name: "}{.name}{"\n  "}{"Image: "}{.image}{"\n"}{"  State: "}{.state}{"\n"}{end}'
  2. To get the details of all the persistent volume claims, execute the following command:

    # oc get pvc
  3. To get the details of the pvc, execute the following command:

    # oc describe pvc <claim_name>

    Verify the volume is mountable and that permissions allow read/write. Also, PVC claim name should match the dynamically provisioned gluster block storage class.

    For more information, see https://access.redhat.com/documentation/en-us/openshift_container_platform/3.11/html-single/configuring_clusters/#install-config-aggregate-logging-sizing.