Deployment

Container Repository

In order to consume the csi-driver and csi-operator container images built in the previous steps, the images should be pushed to a container repository.

  • Quay.io (recommended)

    Follow this tutorial to configure quay.io.

    Create two repositories: ibm-spectrum-scale-csi-operator and ibm-spectrum-scale-csi-driver.

  • Docker

    Deploying your own Docker registry is an involved process and outside of the scope of this document.

The documentation will assume that the quay.io path is being used.

Pushing the image

Once you have a repository ready:

#
# Configure some variables
#
# VERSION - a tag version for your image
VERSION="v0.0.1"
# MYUSER  - A user or organization for your container registry
MYUSER="<your-user>"

# Authenticate to quay.io
docker login <credentials> quay.io

# Tag and push the operator image
docker tag ibm-spectrum-scale-csi-operator quay.io/${MYUSER}/ibm-spectrum-scale-csi-operator:${VERSION}
docker push quay.io/${MYUSER}/ibm-spectrum-scale-csi-operator:${VERSION}

# Tag and push the driver image
docker tag ibm-spectrum-scale-csi-driver quay.io/${MYUSER}/ibm-spectrum-scale-csi-driver:${VERSION}
docker push quay.io/${MYUSER}/ibm-spectrum-scale-csi-driver:${VERSION}

# OPERATOR_DIR has been defined in previous steps
cd ${OPERATOR_DIR}
# Use a helper script to update your deployment to point at your operator image
ansible-playbook hacks/change_deploy_image.yml --extra-vars "quay_operator_endpoint=quay.io/${MYUSER}/ibm-spectrum-scale-csi-operator:${VERSION}"

Installing the CSI Operator

Note

For OpenShift environments, replace kubectl with oc

Run the following to deploy the IBM Spectrum Scale CSI operator manually:

# OPERATOR_DIR has been defined in the previous steps
kubectl apply -f ${OPERATOR_DIR}/deploy/namespace.yaml
kubectl apply -f ${OPERATOR_DIR}/deploy/operator.yaml
kubectl apply -f ${OPERATOR_DIR}/deploy/role.yaml
kubectl apply -f ${OPERATOR_DIR}/deploy/role_binding.yaml
kubectl apply -f ${OPERATOR_DIR}/deploy/service_account.yaml
kubectl apply -f ${OPERATOR_DIR}/deploy/crds/csiscaleoperators.csi.ibm.com.crd.yaml

Installing the CSI Driver

Tip

Before starting the plugin, ensure that any GUI secrets have been added to the appropriate namespace.

A Custom Resource (CR) file is provided csiscaleoperators.csi.ibm.com.cr.yaml. Modify this file to match the properties in your environment.

To start:

kubectl apply -f ${OPERATOR_DIR}/deploy/crds/csiscaleoperators.csi.ibm.com.cr.yaml

To stop:

kubectl delete -f ${OPERATOR_DIR}/deploy/crds/csiscaleoperators.csi.ibm.com.cr.yaml

Removing the CSI Operator and Driver

To remove the IBM Spectrum Scale CSI Operator and Driver:

# The following removes the csi-driver
kubectl delete -f ${OPERATOR_DIR}/deploy/crds/csiscaleoperators.csi.ibm.com.cr.yaml

# The following removes the csi-operator
kubectl delete -f ${OPERATOR_DIR}/deploy/operator.yaml
kubectl delete -f ${OPERATOR_DIR}/deploy/role.yaml
kubectl delete -f ${OPERATOR_DIR}/deploy/role_binding.yaml
kubectl delete -f ${OPERATOR_DIR}/deploy/service_account.yaml
kubectl delete -f ${OPERATOR_DIR}/deploy/crds/csiscaleoperators.csi.ibm.com.crd.yaml

# The following removes the namespace
kubectl delete -f ${OPERATOR_DIR}/deploy/namespace.yaml

This will completely destroy the operator, driver, and all associated resources.