Skip to main content
Hitachi Vantara Knowledge

Installation

This chapter describes how to install Storage Plug-in for Containers. The installation method depends on whether your environment is OpenShift or Kubernetes.

Installation on OpenShift

Storage Plug-in for Containers is easily deployed to OpenShift using the Operator, which can be installed from OperatorHub. To install Storage Plug-in for Containers, follow the steps below.

Note

Procedure

  1. Access OperatorHub from the OpenShift web console.

  2. Search Hitachi Storage Plug-in for Containers and install the Operator.

    NoteSelect the following settings in Operator Subscription:
    • Installation mode: A specific namespace on the cluster and <any namespace>
    • Update approval: Manual and approve the Install Plan (see https://docs.openshift.com/).
  3. Confirm the status of the Operator is Succeeded.

  4. Confirm the status of the Operator Pod is Running.

  5. Click Create Instance on the Operator Details.

  6. Click Create. If you want to make an advanced configuration, refer to Configuration of Storage Plug-in for Containers instance.

  7. Confirm the status READY is true using the following command:

    # oc get hspc -n <namespace for hspc>
    NAME	READY	AGE
    hspc	true	30s
    

Installation on Kubernetes

For Kubernetes, you can install Storage Plug-in for Containers using Operator. Perform the following steps to install Storage Plug-in for Containers and to get container images from Red Hat registry.
NoteIf there is a previous version of Storage Plug-in for Containers, remove it before performing the installation procedure.

Procedure

  1. Extract the Storage Plug-in for Containers package and move to the directory yaml/operator.

  2. Create the namespace for the Operator:

    # kubectl create -f hspc-operator-namespace.yaml
  3. Create the Secret for Red Hat registry. Create it with the regcred-redhat-com Secret name. (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-by-providing-credentials-on-the-command-line).

    For example:
    # kubectl create secret docker-registry regcred-redhat-com \
      --namespace=hspc-operator-system \
      --docker-server=registry.connect.redhat.com \
      --docker-username=<user> \
      --docker-password=<password>
    
  4. Create the Operator and confirm the Operator is running:

    # kubectl create -f hspc-operator.yaml
    
    # kubectl get deployment -n hspc-operator-system
    NAME                              READY  UP-TO-DATE  AVAILABLE   AGE 
    hspc-operator-controller-manager  1/1    1           1           14s
  5. Create two Secrets for Red Hat registry. Create them with the regcred-redhat-com and regcred-redhat-io Secret names.

    For example:
    # SPC_NAMESPACE=<any namespace>
    
    # kubectl create secret docker-registry regcred-redhat-com \
    --namespace=${SPC_NAMESPACE} \
    --docker-server=registry.connect.redhat.com \
    --docker-username=<user> \
    --docker-password=<password>
    
    # kubectl create secret docker-registry regcred-redhat-io \
    --namespace=${SPC_NAMESPACE} \
    --docker-server=registry.redhat.io \
    --docker-username=<user> \
    --docker-password=<password>
    
  6. Modify the namespace if you specified a namespace other than kube-system for SPC_NAMESPACE:

    apiVersion: csi.hitachi.com/v1
    kind: HSPC
    metadata:
      name: hspc
      namespace: <SPC_NAMESPACE>
    spec:
      imagePullSecrets:
      - regcred-redhat-com
      - regcred-redhat-io
    
    If you want to make an advanced configuration, refer to Configuration of Storage Plug-in for Containers instance.
  7. Deploy Storage Plug-in for Containers and confirm the status READY is true using the following command:

    # kubectl create -f hspc_v1_hspc.yaml
    
    # kubectl get hspc -n ${SPC_NAMESPACE}
    NAME READY AGE
    hspc true 30s
    

Configuration of Storage Plug-in for Containers instance

You can configure Storage Plug-in for Containers by editing the CustomResource YAML file, which includes the following parameters:

ParametersDescription
spec.imagePullSecretsImagePullSecrets is for pulling images from Red Hat registries.
spec.controller.containers.name

Name of the Storage Plug-in for Containers that you want to configure in hspc-csi-controller pods.

For example, hspc-csi-driver, csi-provisioner, and so on are the key to the container name inside the hspc-csi-controller.

The kubectl describe deployment hspc-csi-controller -n <SPC_NAMESPACE> command is used to get the container names.

spec.controller.containers.imageThe image name of hspc-csi-controller.
spec.controller.containers.imagePullPolicyThe image pull policy of hspc-csi-controller. The default value is IfNotPresent.
spec.controller.containers.envList of environment variables to set in hspc-csi-controller container. Refer to Environment variables.
spec.controller.containers.argsArguments to the entry point for hspc-csi-controller. This replaces all parameters at spec.template.spec.containers.args in a deployment of the container hspc-csi-controller.
spec.node.containers.name

Name of the container that you want to configure in hspc-csi-node pods.

For example, hspc-csi-driver, liveness-probe, and so on are the key to the container name inside hspc-csi-node.

The kubectl describe daemonset hspc-csi-node -n <SPC_NAMESPACE> command is used to get the container names.

spec.node.containers.imageThe image name of hspc-csi-node.
spec.node.containers.imagePullPolicyThe image pull policy of hspc-csi-node. The default value is IfNotPresent.
spec.node.containers.envList of environment variables to set in hspc-csi-node container.
spec.node.containers.argsArguments to the entry point for hspc-csi-node. This replaces all parameters at spec.template.spec.containers.args in a deployment of the container hspc-csi-node.
spec.node.affinity.nodeAffinityScheduling rule for Node Affinity of the Pod that runs csi-node. The same format as Kubernetes is to be used. For details, see https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/.

Environment variables

The following is the environment variable of hspc-csi-driver on hpsc-csi-controller:

Environment variable nameDescription
SPC_VERIFY_CERTIFICATEIf true, the TLS certificate of the storage is checked in HTTPS connection. (Default: false)
TZTimezone for logging. For example, Asia/Tokyo. (Default: UTC)

The following is an example to enable certificate verification of the hspc-csi-driver.

  1. Check the current settings using the following command:
    # kubectl get deployment -n <SPC_NAMESPACE> hspc-csi-controller -o yaml
    <…>
        - name: hspc-csi-driver  
          env:  
          - name: CSI_ENDPOINT
            value: unix:///csi/csi-controller.sock
          - name: KUBE_NODE_NAME
            valueFrom:
              fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
    <…>
    
  2. Add the parameter env: SPC_VERIFY_CERTIFICATE to Storage Plug-in for Containers manifests.
    apiVersion: csi.hitachi.com/v1
    kind: HSPC
    metadata:
      name: hspc
      namespace: <SPC_NAMESPACE>
    spec:
      controller:
        containers:
          - name: hspc-csi-driver
            env:
            - name: SPC_VERIFY_CERTIFICATE
              value: "true"
    
  3. Uninstall and reinstall Storage Plug-in for Containers. For more information on how to uninstall and reinstall Storage Plug-in for Containers, see Installation and Uninstallation.
  4. Check the changes.
    # kubectl get deployment -n <SPC_NAMESPACE> hspc-csi-controller -o yaml
    <…>
        - name: hspc-csi-driver  
          env:
          - name: CSI_ENDPOINT
            value: unix:///csi/csi-controller.sock
          - name: KUBE_NODE_NAME
            valueFrom:
              fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
          - name: SPC_VERIFY_CERTIFICATE
            value: "true"
    <…>
    

 

  • Was this article helpful?