Red Hat Training

A Red Hat training course is available for Red Hat Gluster Storage

4.2. Deploying Container-Native Storage

The following section covers deployment of the Container-Native Storage pods using the cns-deploy tool. If you prefer to manually install Container-Native Storage, see Appendix A, Manual Deployment
  1. You must first provide a topology file for heketi which describes the topology of the Red Hat Gluster Storage nodes and their attached storage devices. A sample, formatted topology file (topology-sample.json) is installed with the ‘heketi-client’ package in the /usr/share/heketi/ directory. .
    {
        "clusters": [
                   {
                      "nodes": [
                                    {
                            "node": {
                                "hostnames": {
                                    "manage": [
                                        "node1.example.com"
                                    ],
                                    "storage": [
                                        "192.168.121.168"
                                     ]
                                 },
                                 "zone": 1
                             },
                             "devices": [
                                 "/dev/sdb",
                                 "/dev/sdc",
                                 "/dev/sdd",
                                 "/dev/sde"
                             ]
                   },...
    
    Edit the topology file based on the Red Hat Gluster Storage pod hostname under the node.hostnames.manage section and node.hostnames.storage section with the IP address. For simplicity, the /usr/share/heketi/topology-sample.json file only sets up 4 nodes with 8 drives each.

    Important

    Heketi stores its database on a Red Hat Gluster Storage volume. In cases where the volume is down, the Heketi service does not respond due to the unavailability of the volume served by a disabled trusted storage pool. To resolve this issue, restart the trusted storage pool which contains the Heketi volume.
  2. Execute the following command on the client to deploy the heketi and Red Hat Gluster Storage pods:
    # cns-deploy -n <namespace> -g topology.json
    For example:
    # cns-deploy -n storage-project -g topology.json
    Multiple CLI options detected. Please select a deployment option.
    [O]penShift, [K]ubernetes? [O/o/K/k]: o
    Using OpenShift CLI.
    template "deploy-heketi" created
    serviceaccount "heketi-service-account" created
    template "heketi" created
    template "glusterfs" created
    node "192.168.121.168" labeled
    node "192.168.121.169" labeled
    node "192.168.121.170" labeled
    daemonset "glusterfs" created
    Waiting for GlusterFS pods to start ... OK
    service "deploy-heketi" created
    route "deploy-heketi" created
    deploymentconfig "deploy-heketi" created
    Waiting for deploy-heketi pod to start ... OK
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100    17  100    17    0     0   2283      0 --:--:-- --:--:-- --:--:--  2428
    Creating cluster ... ID: e9c3135bda886b0770f4fc7131f46061
        Creating node 192.168.121.168 ... ID: 994390ff41b0fc2116962454a860c356
            Adding device /dev/sdb ... OK
            Adding device /dev/sdc ... OK
            Adding device /dev/sdd ... OK
            Adding device /dev/sde ... OK
        Creating node 192.168.121.169 ... ID: 217e1740010b264624043011225ffc14
            Adding device /dev/sdb ... OK
            Adding device /dev/sdc ... OK
            Adding device /dev/sdd ... OK
            Adding device /dev/sde ... OK
        Creating node 192.168.121.170 ... ID: f5ae3ecb0475729fbb70eba5842e52c0
            Adding device /dev/sdb ... OK
            Adding device /dev/sdc ... OK
            Adding device /dev/sdd ... OK
            Adding device /dev/sde ... OK
    Saving heketi-storage.json
    secret "heketi-storage-secret" created
    endpoints "heketi-storage-endpoints" created
    service "heketi-storage-endpoints" created
    job "heketi-storage-copy-job" created
    deploymentconfig "deploy-heketi" deleted
    route "deploy-heketi" deleted
    service "deploy-heketi" deleted
    job "heketi-storage-copy-job" deleted
    secret "heketi-storage-secret" deleted
    service "heketi" created
    route "heketi" created
    deploymentconfig "heketi" created
    Waiting for heketi pod to start ... OK
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100    17  100    17    0     0   2259      0 --:--:-- --:--:-- --:--:--  2428
    heketi is now running.

    Note

    For more information on the cns-deploy commands, refer to the man page of the cns-deploy.
    # cns-deploy --help
  3. Execute the following command to let the client communicate with the container:
    # export  HEKETI_CLI_SERVER=http://heketi-<project_name>.<sub_domain_name>
    For example:
    # export  HEKETI_CLI_SERVER=http://heketi-storage-project.cloudapps.mystorage.com
    To verify if Heketi is loaded with the topology execute the following command:
    # heketi-cli topology info