Skip to content

Commit

Permalink
Samples: Add Pure backend samples
Browse files Browse the repository at this point in the history
This patch adds additional examples for Pure backends:

- Pure Storage iSCSI
- Pure Storage FC
- Pure Storage NVMe-RoCE

The Pure backends have external dependencies not present in the base
cinder-volume container image and therefore need a custom container.

This patch also includes a example of what such custom container looks
like.
  • Loading branch information
Akrog committed Sep 11, 2023
1 parent 202e5b1 commit bec0f7b
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 9 deletions.
21 changes: 12 additions & 9 deletions config/samples/backends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Currently available samples are:
- NetApp ONTAP iSCSI
- NetApp ONTAP FC
- NetApp ONTAP NFS
- Pure Storage iSCSI
- Pure Storage FC
- Pure Storage NVMe-RoCE

## Using Examples

Expand Down Expand Up @@ -62,15 +65,15 @@ If we already have a deployment working we can always use
`oc kustomize lvm/iscsi | oc apply -f -`. from this directory to make the
changes.

Some backends, like 3PAR, require a custom container because they have external
dependencies. So there is a need to build a specific container. In RHOSP
vendors will provide certified containers through Red Hat's container image
registry. For illustration and development purposes this repository provides
samples of what a `Dockerfile` would look like for each of the vendor's. This
`Dockerfile` will be present in the vendor's directory (e.g. `hpe/Dockerfile`),
so we would need to build a container, make it available in a registry, and
then provide it to the cinder operator via the `containerImage` as seen in the
samples.
Some backends, like 3PAR and Pure, require a custom container because they have
external dependencies. So there is a need to build a specific container. In
RHOSP, vendors will provide certified containers through Red Hat's container
image registry. For illustration and development purposes this repository
provides samples of what a `Dockerfile` would look like for each of the
vendor's. This `Dockerfile` will be present in the vendor's directory (e.g.
`hpe/Dockerfile` and `pure/Dockerfile`), so we would need to build a container,
make it available in a registry, and then provide it to the cinder operator via
the `containerImage` as seen in the samples.

## Ceph example

Expand Down
23 changes: 23 additions & 0 deletions config/samples/backends/pure/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Pure Storage Cinder Volume container for Antelope deployments

FROM quay.io/podified-antelope-centos9/openstack-cinder-volume:current-podified

ARG min_pureclient_version=1.17.0

LABEL maintainer="Pure Storage" \
description="OpenStack cinder-volume Pure Storage" \
summary="OpenStack cinder-volume Pure Storage" \
name="geguileo/podified-antelope-openstack-cinder-volume-pure:current-podified" \
vendor="Pure Storage" \
min_pureclient="${pureclient_version}"

# Switch to root to install packages
USER root

RUN curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" && \
python3 get-pip.py && \
pip3 install "purestorage>=${min_pureclient_version}" && \
rm -f get-pip.py

# Switch to cinder user
USER cinder
31 changes: 31 additions & 0 deletions config/samples/backends/pure/fc/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# To be able to use this sample it is necessary to:
# - Have a Pure backend with iSCSI support
# - Have the Pure storage credentials in cinder-volume-pure-secrets.yaml
# - Having iscsid and multpathd running on the host (done by this sample)
# - Build a cinder-volume container with the pure cinder driver dependency, make it available in a registry accessible by OpenShift, and set its location in this file's containerImage
#
# There is a sample Dockerfile in the parent directory showing how the cinder-volume container in this containerImage was created.
# The correct way to configure and run the daemons is using `MachineConfig` as shown in `iscsid.yaml` and `multipathd.yaml`, like this samle does.
#
# ATTENTION: After applying this OpenShift nodes will reboot, because of the `MachineConfig` changes and will take a while to recover.

apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: openstack
spec:
cinder:
template:
cinderVolumes:
pure-fc:
networkAttachments:
- storage
containerImage: quay.io/geguileo/podified-antelope-openstack-cinder-volume-pure:current-podified
# Configuration details available at
# https://pure-storage-openstack-docs.readthedocs.io/en/latest/cinder/ch_cinder-configuration.html
customServiceConfigSecrets:
- cinder-volume-pure-secrets
customServiceConfig: |
[pure]
volume_backend_name=pure
volume_driver=cinder.volume.drivers.pure.PureFCDriver
15 changes: 15 additions & 0 deletions config/samples/backends/pure/fc/cinder-volume-pure-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Define the "cinder-volume-pure-secrets" Secret that contains sensitive
# information pertaining to the [pure] backend.
apiVersion: v1
kind: Secret
metadata:
labels:
service: cinder
component: cinder-volume
name: cinder-volume-pure-secrets
type: Opaque
stringData:
pure-secrets.conf: |
[pure]
san_ip=12.168.1.32
pure_api_token=c6033033-fe69-2515-a9e8-966bb7fe4b40
6 changes: 6 additions & 0 deletions config/samples/backends/pure/fc/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resources:
- ../../bases/multipathd
- ../../bases/openstack
- cinder-volume-pure-secrets.yaml
patches:
- backend.yaml
31 changes: 31 additions & 0 deletions config/samples/backends/pure/iscsi/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# To be able to use this sample it is necessary to:
# - Have a Pure backend with iSCSI support
# - Have the Pure storage credentials in cinder-volume-pure-secrets.yaml
# - Having iscsid and multpathd running on the host (done by this sample)
# - Build a cinder-volume container with the pure cinder driver dependency, make it available in a registry accessible by OpenShift, and set its location in this file's containerImage
#
# There is a sample Dockerfile in the parent directory showing how the cinder-volume container in this containerImage was created.
# The correct way to configure and run the daemons is using `MachineConfig` as shown in `iscsid.yaml` and `multipathd.yaml`, like this samle does.
#
# ATTENTION: After applying this OpenShift nodes will reboot, because of the `MachineConfig` changes and will take a while to recover.

apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: openstack
spec:
cinder:
template:
cinderVolumes:
pure-iscsi:
networkAttachments:
- storage
containerImage: quay.io/geguileo/podified-antelope-openstack-cinder-volume-pure:current-podified
# Configuration details available at
# https://pure-storage-openstack-docs.readthedocs.io/en/latest/cinder/ch_cinder-configuration.html
customServiceConfigSecrets:
- cinder-volume-pure-secrets
customServiceConfig: |
[pure]
volume_backend_name=pure
volume_driver=cinder.volume.drivers.pure.PureISCSIDriver
15 changes: 15 additions & 0 deletions config/samples/backends/pure/iscsi/cinder-volume-pure-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Define the "cinder-volume-pure-secrets" Secret that contains sensitive
# information pertaining to the [pure] backend.
apiVersion: v1
kind: Secret
metadata:
labels:
service: cinder
component: cinder-volume
name: cinder-volume-pure-secrets
type: Opaque
stringData:
pure-secrets.conf: |
[pure]
san_ip=12.168.1.32
pure_api_token=c6033033-fe69-2515-a9e8-966bb7fe4b40
7 changes: 7 additions & 0 deletions config/samples/backends/pure/iscsi/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resources:
- ../../bases/iscsid
- ../../bases/multipathd
- ../../bases/openstack
- cinder-volume-pure-secrets.yaml
patches:
- backend.yaml
32 changes: 32 additions & 0 deletions config/samples/backends/pure/nvme-roce/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# To be able to use this sample it is necessary to:
# - Have a Pure backend with NVMe-RoCE support
# - Have the Pure storage credentials in cinder-volume-pure-secrets.yaml
# - Having nvme-fabrics kernel module loaded on the host (done by this sample)
# - Build a cinder-volume container with the pure cinder driver dependency, make it available in a registry accessible by OpenShift, and set its location in this file's containerImage
#
# There is a sample Dockerfile in the parent directory showing how the cinder-volume container in this containerImage was created.
# The correct way to configure and run the daemons is using `MachineConfig` as shown in `nvme-fabrics.yaml`, like this sample does.
#
# ATTENTION: After applying this OpenShift nodes will reboot, because of the `MachineConfig` changes and will take a while to recover.

apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: openstack
spec:
cinder:
template:
cinderVolumes:
pure-nvme-roce:
networkAttachments:
- storage
containerImage: quay.io/geguileo/podified-antelope-openstack-cinder-volume-pure:current-podified
# Configuration details available at
# https://pure-storage-openstack-docs.readthedocs.io/en/latest/cinder/ch_cinder-configuration.html
customServiceConfigSecrets:
- cinder-volume-pure-secrets
customServiceConfig: |
[pure]
volume_backend_name=pure
volume_driver=cinder.volume.drivers.pure.PureNVMEDriver
pure_nvme_transport=roce
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Define the "cinder-volume-pure-secrets" Secret that contains sensitive
# information pertaining to the [pure] backend.
apiVersion: v1
kind: Secret
metadata:
labels:
service: cinder
component: cinder-volume
name: cinder-volume-pure-secrets
type: Opaque
stringData:
pure-secrets.conf: |
[pure]
san_ip=12.168.1.32
pure_api_token=c6033033-fe69-2515-a9e8-966bb7fe4b40
7 changes: 7 additions & 0 deletions config/samples/backends/pure/nvme-roce/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resources:
- ../../bases/nvmeof
- ../../bases/multipathd
- ../../bases/openstack
- cinder-volume-pure-secrets.yaml
patches:
- backend.yaml

0 comments on commit bec0f7b

Please sign in to comment.