ibm-storage-enabler-for-containers

by Helm

Helm chartv1.0.1App 2.1.0Apache-2.0

A Helm chart for IBM Storage Enabler for Containers

About this chart

IBM Storage Enabler for Containers

Introduction

IBM Storage Enabler for Containers (ISEC) allows IBM storage systems to be used as persistent volumes for stateful applications running in Kubernetes clusters. IBM Storage Enabler for Containers uses Kubernetes dynamic provisioning for creating and deleting volumes on IBM storage systems. In addition, IBM Storage Enabler for Containers utilizes the full set of Kubernetes FlexVolume APIs for volume operations on a host. The operations include initiation, attachment/detachment, mounting/unmounting etc.

Chart Details

This chart includes:

  • A Storage Enabler for Containers server for running Kubernetes Dynamic Provisioner and FlexVolume.
  • A Storage Enabler for Containers database for storing the persistent data for the Enabler for Container service.
  • A Kubernetes Dynamic Provisioner for creating storage volumes on-demand, using Kubernetes storage classes based on Spectrum Connect storage services or Spectrum Scale storage classes.
  • A Kubernetes FlexVolume DaemonSet for attaching/detaching and mounting/unmounting storage volumes into a pod within a Kubernetes node.

Prerequisites

IBM block storage

Before installing the Helm chart for Storage Enabler for Containers in conjuction with IBM block storage:

  • Install and configure IBM Spectrum Connect, according to the application requirements.
  • Establish a proper communication link between Spectrum Connect and Kubernetes cluster.
  • For ICP deployment, make sure the user has the cluster admin access level.
  • For each worker node:
    • Install relevant Linux packages to ensure Fibre Channel and iSCSI connectivity.
    • Configure Linux multipath devices on the host.
    • Configure storage system connectivity.
    • Make sure that the node kubelet service has the attach/detach capability enabled.
  • For each master node:
    • Enable the attach/detach capability for the kubelet service.
    • If the controller-manager is configured to run as a pod in your Kubernetes cluster, allow for event recording in controller-manager log file.

The next configuration steps describe installation using command-line interface. For installation, using ICP GUI, see the Installation section of the Enabler for Containers user guide.

  • Create a namespace for two secrets:
kubectl create ns <namespace_name>
  • Create two secrets: Enabler for Containers secret for Spectrum Connect and Enabler for Containers secret for its database. Verify that Spectrum Connect credentials secret username and password are the same as Enabler for Containers interface username and password in Spectrum Connect UI.
kubectl create secret generic <enabler_sc_credentials_secret_name> --from-literal=username=<username> --from-literal=password=<password> -n <namespace>
kubectl create secret generic <enabler_db_credentials_secret_name> --from-literal=dbname=ubiquity --from-literal=username=<username> --from-literal=password=<password> -n <namespace>
  • If dedicated SSL certificates are required, see the Managing SSL certificates section in the IBM Storage Enabler for Containers user guide.
  • When using IBM Cloud Private with the Spectrum Virtualize Family products, use only hostnames for the Kubernetes cluster nodes, do not use IP addresses.

IBM Spectrum Scale

Prior to installing the Helm chart for Storage Enabler for Containers in conjunction with IBM Spectrum Scale:

  • Install and configure IBM Spectrum Scale, according to the application requirements.
  • Establish a proper communication link between Spectrum Scale Management GUI Address and Kubernetes cluster.
  • For each worker node:
    • Install Spectum Scale client packages.
    • Mount Spectrum Scale filesystem for persistent storage.
  • For each master node:
    • Enable the attach/detach capability for the kubelet service.
    • If the controller-manager is configured to run as a pod in your Kubernetes cluster, allow for event recording in controller-manager log file.
  • Create a namespace for two secrets:
kubectl create ns <namespace_name>
  • Create two secrets: Enabler for Containers secret for Spectrum Scale and Enabler for Containers secret for its database. Verify that Spectrum Scale credentials secret username and password are the same as Enabler for Containers username and password define for Spectrum Scale Management API (GUI) Server.
kubectl create secret generic <enabler_scale_credentials_secret_name> --from-literal=username=<username> --from-literal=password=<password> -n <namespace>
kubectl create secret generic <enabler_db_credentials_secret_name> --from-literal=dbname=ubiquity --from-literal=username=<username> --from-literal=password=<password> -n <namespace>

These configuration steps are mandatory and cannot be skipped. For detailed description of installation prerequisites, see the Compatibility and Requirements sections for IBM Spectrum Connect and IBM Spectrum Scale in the IBM Storage Enabler for Containers user guide on IBM Knowledge Center at https://www.ibm.com/support/knowledgecenter/SSCKLT.

PodSecurityPolicy Requirements

This chart requires a PodSecurityPolicy to be bound to the target namespace prior to installation or to be bound to the current namespace during installation by setting "customPodSecurityPolicy.enabled" to "true" and setting "customPodSecurityPolicy.clusterRole".

The recommended predefined PodSecurityPolicy name: ibm-anyuid-hostpath-psp has been verified for this chart, if your target namespace is bound to this PodSecurityPolicy you can proceed to install the chart. The predefined clusterRole name: ibm-anyuid-hostpath-clusterrole has been verified for this chart, if you use it you can proceed to install the chart.

You can also define a custom PodSecurityPolicy which can be used to finely control the permissions/capabilities needed to deploy this chart. You can enable this custom PodSecurityPolicy using the ICP user interface.

  • From the user interface, you can copy and paste the following snippets to enable the custom PodSecurityPolicy
    • Custom PodSecurityPolicy definition:
      apiVersion: extensions/v1beta1
      kind: PodSecurityPolicy
      metadata:
        annotations:
          kubernetes.io/description: "This policy allows pods to run with 
            any UID and GID and any volume, including the host path.
            WARNING:  This policy allows hostPath volumes.
            Use with caution."
        name: custom-psp
      spec:
        allowPrivilegeEscalation: true
        fsGroup:
          rule: RunAsAny
        requiredDropCapabilities:
        - MKNOD
        allowedCapabilities:
        - SETPCAP
        - AUDIT_WRITE
        - CHOWN
        - NET_RAW
        - DAC_OVERRIDE
        - FOWNER
        - FSETID
        - KILL
        - SETUID
        - SETGID
        - NET_BIND_SERVICE
        - SYS_CHROOT
        - SETFCAP
        runAsUser:
          rule: RunAsAny
        seLinux:
          rule: RunAsAny
        supplementalGroups:
          rule: RunAsAny
        volumes:
        - '*'
      
    • Custom ClusterRole for the custom PodSecurityPolicy:
      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRole
      metadata:
        name: custom-clusterrole
      rules:
      - apiGroups:
        - extensions
        resourceNames:
        - custom-psp
        resources:
        - podsecuritypolicies
        verbs:
        - use
      

Resources Required

IBM Storage Enabler for Containers can be deployed on different operating systems, while provisioning storage from a variety of IBM arrays, as detailed in the release notes of the package.

Installing the Chart

First add the IBM Stable charts repository:

$ helm repo add --tls ibm-stable https://raw.githubusercontent.com/IBM/charts/master/repo/stable

To install the chart with the release name my-release:

$ helm install --tls --name my-release --namespace ubiquity ibm-stable/ibm-storage-enabler-for-containers

The command deploys on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Note: You can list all releases using the helm list --tls command.

Verifying the Chart

You can check the status by running:

$ helm status --tls my-release

If all statuses are free of errors, you can run sanity test by:

$ helm test --tls my-release

Uninstalling the Chart

Verify that there are no persistent volumes (PVs) that have been created, using IBM Storage Enabler for Containers. To uninstall/delete the my-release release:

$ helm delete --tls `my-release` --purge

The command removes the IBM Storage Enabler for Containers components associated with the Helm chart, metadata, user credentials, and other elements.

When the Helm chart is deleted, the first elements to be removed are the Enabler for Container database deployment and its PVC. If the helm delete command fails after several attempts, delete these entities manually before continuing. Then, verify that the Enabler for Container database deployment and its PVC are deleted, and complete the uninstall procedure by running

$ helm delete --tls `my-release` --purge --no-hooks

Configuration

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

ParameterDescriptionDefault
backendBackend type for Provisioner and FlexVolume. Allowed values: spectrumConnect or spectrumScalespectrumConnect
spectrumConnect.connectionInfo.fqdnIP address or FQDN of the Spectrum Connect server.
spectrumConnect.connectionInfo.portCommunication port of the Spectrum Connect server.8440
spectrumConnect.connectionInfo.existingSecretSecret for Spectrum Connect interface. The value must be the same as configured in Spectrum Connect. Keys username and password are mandatory.
spectrumConnect.backendConfig.instanceNameA prefix for any new volume created on the storage system.
spectrumConnect.backendConfig.defaultStorageServiceDefault Spectrum Connect storage service to be used, if not specified by the storage class.
spectrumConnect.backendConfig.newVolumeDefaults.fsTypeFile system type of a new volume, if not specified by the user in the storage class. Allowed values: ext4 or xfs.ext4
spectrumConnect.backendConfig.newVolumeDefaults.sizeDefault volume size (in GiB), if not specified by the user when creating a new volume.1
spectrumConnect.storageClass.storageServiceThe Spectrum Connect storage service which is directed to Enabler for Containers DB storage class profile.

Deploy ibm-storage-enabler-for-containers with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-storage-enabler-for-containers 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-storage-enabler-for-containers is pinned at v1.0.1 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