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.
- If there is a previous version of Storage Plug-in for Containers, remove it before performing the installation procedure.
- If you want to install Storage Plug-in for Containers in an OpenShift
Container Platform environment that does not have access to the internet,
mirror the certified-operators catalog in advance. For details on the
procedure, see https://docs.openshift.com/container-platform/latest/installing/disconnected_install/installing-mirroring-installation-images.html#olm-mirror-catalog_installing-mirroring-installation-images.
For example, for OpenShift Container Platform version 4.10, the index image of the certified-operators catalog is registry.redhat.io/redhat/certified-operator-index:v4.10. For details, see https://docs.openshift.com/container-platform/latest/operators/understanding/olm-rh-catalogs.html.
Procedure
Access OperatorHub from the OpenShift web console.
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>
- Approval Strategy: Manual and approve the Install Plan (see https://docs.openshift.com/).
Confirm the status of the Operator is Succeeded.
Confirm the status of the Operator Pod is Running.
Click Create Instance on the Operator Details.
Click Create. If you want to make an advanced configuration, refer to Configuration of Storage Plug-in for Containers instance.
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
Procedure
Extract the Storage Plug-in for Containers package and move to the directory yaml/operator.
Create the namespace for the Operator:
# kubectl create -f hspc-operator-namespace.yaml
Create the Secret for Red Hat registry (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>
Create the Operator and confirm the Operator is running:
# kubectl patch sa default \ -n hspc-operator-system \ -p '{"imagePullSecrets": [{"name": "regcred-redhat-com" }]}' # 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
Create two Secrets for Red Hat registry. 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>
Add the Secrets created in step 5 as imagePullSecrets to hspc_v1_hspc.yaml and modify the namespace if you specified 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.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:
Parameters | Description |
spec.imagePullSecrets | ImagePullSecrets 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 For example, The |
spec.controller.containers.image | The image name of hspc-csi-controller . |
spec.controller.containers.imagePullPolicy | The image pull policy of hspc-csi-controller . The default value is
IfNotPresent. |
spec.controller.containers.env | List of environment variables to set in hspc-csi-controller container. Refer
to Environment variables. |
spec.controller.containers.args | Arguments 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 For example, The |
spec.node.containers.image | The image name of hspc-csi-node . |
spec.node.containers.imagePullPolicy | The image pull policy of hspc-csi-node . The default value is
IfNotPresent. |
| List of environment variables to set in hspc-csi-node container. |
spec.node.containers.args | Arguments 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.nodeAffinity | Scheduling 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 name | Description |
SPC_VERIFY_CERTIFICATE | If true, the TLS certificate of the storage is checked in HTTPS connection. (Default: false) |
TZ | Timezone for logging. For example, Asia/Tokyo. (Default: UTC) |
The following is an example to enable certificate verification of the hspc-csi-driver
.
- 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 <…>
- 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"
- 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.
- 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" <…>