ibm-glusterfs

by Helm

Helm chartv1.4.0App 1.0Apache-2.0

A Helm chart to create GlusterFS Storage Cluster

About this chart

GlusterFS Storage Cluster

Introduction

GlusterFS is a Scale Out Network Attached Storage file system.

Heketi provides a RESTful management interface that can be used to manage the lifecycle of GlusterFS volumes.

The ibm-glusterfs Helm chart deploys a GlusterFS storage cluster on the storage nodes in your IBM® Cloud Private cluster. It also deploys Heketi to manage the lifecycle of the storage cluster and dynamically create volumes. The application workload can then use the Heketi service to create volumes for data persistence from the GlusterFS storage cluster. Along with the GlusterFS storage cluster, the chart also creates a storage class with GlusterFS as the provisioner.

Chart Details

The Helm chart completes the following tasks:

  • Runs a precheck job to validate the storage class name, Heketi authentication secret name, Heketi backup database secret name, storage node name, storage node IP address, Heketi topology, device path, kernel modules that were loaded, and GlusterFS ports.
  • Creates a configmap based on the precheck validation.
  • Creates a secret to store the Heketi database.
  • Deploys GlusterFS as a daemonset onto the Kubernetes nodes that you labeled as storage nodes.
  • Creates the Heketi service and Heketi deployment to communicate with GlusterFS.
  • Creates the storage class if it is set to true.

Limitations

  • The chart supports the installation of only a new storage cluster under kube-system namespace.
  • The chart supports creation of only one GlusterFS storage cluster in an IBM® Cloud Private cluster.
  • Upgrade from previous versions of this chart to current version must be done after IBM Cloud Private cluster is upgraded to Version 3.2.0.

Prerequisites

  • An IBM® Cloud Private Version 3.2.0 or later must be installed.
  • The default configuration is to use three storage nodes to configure GlusterFS Storage cluster. However, you can use less than three storage nodes to configure GlusterFS Storage cluster. You need at least one storage to successfully install GlusterFS.
  • In storage class configuration, if you specify volumeType as replicate with more than one replica count, or if you specify volumeType as disperse with more than one redundancy count, then you must use as many storage nodes as the specified replica or redundancy count. For more information about creating storage nodes, see Deployment Scenarios.
  • The storage device that is used for GlusterFS must have a capacity of at least 25 GB.
  • The storage devices that you use for GlusterFS must be raw disks. They must not be formatted, partitioned, or used for file system storage needs. You must use the symbolic link (symlink) to identify the GlusterFS storage device. For more information about creating symlinks, see Storage Devices.
  • You must install the dm_thin_pool kernel module on all the storage nodes. For more information, see Configure dm_thin_pool.
  • You must install the GlusterFS client on the nodes in your cluster that might use a GlusterFS volume. For more information, see Install GlusterFS client
  • The GlusterFS client version must be the same as the version of the GlusterFS server that is installed.
  • You must pre-create a secret with a password for the Heketi user 'admin' and provide the secret name in the heketi.authSecret parameter. Follow these steps to create the secret:
    1. Encode the new password in base64 and update the admin_password section with the new base64-encoded password.

      echo -n "admin" | base64
      
      YWRtaW4=
      
    2. Use the management console or kubectl to create the secret:

      kind: Secret
      apiVersion: v1
      metadata:
        name: heketi-secret
        labels:
          glusterfs: "heketi-secret"
      type: kubernetes.io/glusterfs
      data:
        admin_password: YWRtaW4=
      
      
      kubectl apply -f secrets.yaml -n kube-system
      

      Note: The name of the key must be the same as admin_password.

PodSecurityPolicy Requirements

The ibm-glusterfs-chart chart requires a pod security policy to be bound to the target namespace before installation. You may either choose the predefined pod security policy or create your own pod security policy.

  • For IBM Cloud Private, the predefined pod security policy name is ibm-privileged-psp.
  • If you want to create your own pod security policy, make sure the security policy you create has same privileges as provided by ibm-privileged-psp.

Deployment Scenarios

GlusterFS storage cluster can be deployed on dedicated storage host group nodes or on worker nodes.

Dedicated GlusterFS storage nodes

Define a custom host group with at least three nodes. For more information about defining a host group, see Defining custom host groups. This custom host group automatically labels the nodes and taints them to make the nodes dedicated for GlusterFS Storage. If you enabled firewall in your cluster, you need to open all the ports that are used by GlusterFS daemon and bricks.

Worker nodes as GlusterFS storage nodes

Ensure that you use at least three worker nodes to configure GlusterFS. You have two options to install GlusterFS on worker nodes.

  • You can use existing IBM Cloud Private worker nodes to install GlusterFS. You must manually label these nodes.

(OR)

  • You can use dedicated nodes to configure GlusterFS and add these nodes as worker nodes during custom host group creation. To skip the node tainting, you must set the no_taint_group: ["<hostgroup-name>"] parameter in the /<installation_directory>/cluster/config.yaml file.

Configure GlusterFS storage nodes

  • Configure GlusterFS on dedicated nodes

    1. Configure a custom host group with the dedicated GlusterFS storage nodes. For more information about how to add a host group, see Adding a host group.

      Following is an example configuration of a host group with dedicated GlusterFS storage nodes. You add this configuration in the /<installation_directory>/cluster/hosts file.

      Note: The worker nodes and the GlusterFS storage nodes are not the same.

      [worker]
      2.2.2.2
      ...
      2.2.2.9
      .
      .
      [hostgroup-glusterfs]
      6.6.6.6
      ...
      6.6.6.9
      
    2. If firewall is enabled, add the list of required ports to the /<installation_directory>/cluster/config.yaml file. Locate the section firewall_enabled: true. Add the following ports for the custom host group that you created with dedicated GlusterFS storage nodes.

      Following is an example configuration of the custom host group hostgroup-glusterfs:

      firewall_open_ports:
        hostgroup-glusterfs:
          - 24007/tcp
          - 24008/tcp
          - 2222/tcp
          - 49152-49251/tcp
      
  • Configure GlusterFS on nodes that are also used as worker nodes

    1. Complete the steps mentioned in the section "Configure GlusterFS on dedicated nodes".

    2. Add no_taint_group: ["<hostgroup-name>"] parameter in the /<installation_directory>/cluster/config.yaml file.

      Following is an example configuration of adding the no_taint_group parameter. You add this configuration in the /<installation_directory>/cluster/config.yaml file.

      no_taint_group: ["hostgroup-glusterfs"]
      
  • Configure GlusterFS on existing worker nodes

    1. You must manually label these nodes. For example, following is the command to add storagenode=glusterfs as the label:

      kubectl label nodes <node1_ipaddr node2_ipaddr node3_ipaddr...> storagenode=glusterfs --overwrite=true
      

      Note:

      • You must use the same label key and value pair in nodeSelector.key and nodeSelector.value parameters.
      • Sometimes, these manually labeled nodes are not persisted.
    2. If firewall is enabled, ensure that the ports that are used by GlusterFS daemon (24007), GlusterFS management (24008), SSHD (2222), and bricks (49152:49251) are added to the firewall.

      Note: You must manually add firewall rules for these ports.

Storage Devices

You must use the symlink to identify the GlusterFS storage device. Do not use device names, such as /dev/sdb, because the name might change between system restarts.

Note: The special characters that Heketi allows to be used in the device name are ^/[a-zA-Z0-9_.:/-]+$. If your device name or system-generated symlink has special characters that are not allowed by Heketi, then you must manually create the symlink.

Use system generated symlinks

To get the symlink that the system assigns to a device, complete these steps:

  1. Identify the storage devices to use. You can list the available storage devices by entering this command:

    $ ls -altr /dev/disk/*
    
  2. Identify devices that have at least 25 GB of storage capacity.

  3. Erase all file system, raid, and partition-table signatures by using the wipefs command. For example, to erase the signatures on device /dev/sdb, run the following command:

    $ sudo wipefs --all --force /dev/sdb
    
  4. Get the symlink of the device by entering this command:

    $ ls -altr /dev/disk/*
    
  5. Make a note of the symlink and its link path. For each device that you are using for GlusterFS configuration, you need to add the <link path>/<symlink>.

Use manually created symlinks

In some environments, such as IBM Cloud VSI or SUSE Linux Enterprise Server (SLES), no symlinks are automatically generated for the devices. You must manually create symlinks by writing custom udev (userspace /dev) rules. When you create the symlink, use attributes that are unique to the device.

Following example includes steps to manually generate symlinks. The steps might vary with operating systems and environments.

  1. Get information about the device's attributes.

    $ udevadm info --root --name=/dev/vdb
    

    The output resembles the following code:

    P: /devices/pci0000:00/0000:00:10.0/virtio4/block/vdb
    N: vdb
    E: DEVNAME=/dev/vdb
    E: DEVPATH=/devices/pci0000:00/0000:00:10.0/virtio4/block/vdb
    E: DEVTYPE=disk
    E: MAJOR=253
    E: MINOR=16
    E: SUBSYSTEM=block
    E: TAGS=:systemd:
    E: USEC_INITIALIZED=6705725
    E: elevator=noop
    

    Use the DEVTYPE, SUBSYSTEM, and DEVPATH attributes to create the symlink of the device.

  2. Create a custom udev rules file.

    $ vi /lib/udev/rules.d/10-custom-icp.rules
    

    Add these lines of code to the file. Replace the attribute values with your device attribute values.

    ENV{DEVTYPE}=="disk", ENV{SUBSYSTEM}=="block", ENV{DEVPATH}=="/devices/pci0000:00/0000:00:10.0/virtio4/block/vdb" SYMLINK+="disk/gluster-disk-1"
    
  3. Reload the udev rules to create the symlinks.

    $ udevadm control --reload-rules
    $ udevadm trigger --type=devices --action=change
    
  4. Verify that the symlinks are created.

    $ ls -ltr /dev/disk/gluster-*
    

    The output resembles the following code:

    lrwxrwxrwx 1 root root 3 Jul  4 23:12 /dev/disk/gluster-disk-1 -> ../../vdb
    

Resources Required

The GlusterFS and Heketi containers have the following resource requests and limits:

ContainerMemory RequestMemory LimitCPU RequestCPU Limit
GlusterFS512Mi1Gi500m1000m
Heketi512Mi1Gi500m1000m

Installing GlusterFS cluster

Installing the Chart

To install ibm-glusterfs chart from the command line with release name my-release:

$ helm install --name my-release --namespace kube-system -f  values.yaml stable/ibm-glusterfs --tls

Configuration

The following table lists the configurable parameters of the ibm-glusterfs chart and their default values.

ParameterDescriptionDefault
arch.amd64Architecture preference for amd64 node2 - No preference
arch.ppc64leArchitecture preference for ppc64le node2 - No preference
arch.s390xArchitecture preference for s390x node2 - No preference
preValidation.image.repositoryPre-validation image to use for this deploymentibmcom/icp-storage-util
preValidation.image.tagPre-validation image tag to use for this deployment3.2.0
preValidation.image.pullPolicyPre-validation image pull policyIfNotPresent
gluster.image.repositoryGlusterFS image to use for this deploymentibmcom/gluster
gluster.image.tagGlusterFS imag

Deploy ibm-glusterfs with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-glusterfs on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartibm-glusterfs is pinned at v1.4.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply