Install Portworx CSI on an airgapped cluster
This guide explains how to set up an air-gapped installation of Portworx CSI with OpenShift and Kubernetes, ensure that all prerequisites and configurations are met before deploying Portworx.
Prerequisites
- Ensure that system requirements are met.
- Ensure your Kubernetes cluster is configured according to the backend storage you plan to use. Refer to the following pages for detailed instructions:
Configure your registry with Portworx CSI image
- Kubernetes
- OpenShift
-
Set the environment variable for the Kubernetes version from an internet-connected host by running the following command:
KBVER
: Retrieves the Kubernetes version from your cluster for compatibility with Portworx CSI.PXVER
: Specifies the required Portworx CSI version.
KBVER=$(kubectl version | awk -F'[v+_-]' '/Kubernetes/ {print $2}')
PXVER=<portworx-CSI-version> # e.g., 25.1.0 -
Download bootstrap script using the following command. It will download the specified Kubernetes and Portworx CSI versions that you have set previously. It helps you pull and prepare the container images required for installation:
curl -o px-ag-install.sh -L "https://install.portworx.com/$PXVER/air-gapped?kbver=$KBVER"
-
Pull required container images for your installation:
sh px-ag-install.sh pull
-
Authenticate a private registry that is accessible to your air-gapped nodes:
docker login --username <user-name> --password-stdin <password>
-
Push the container images to the private registry:
sh px-ag-install.sh push <your-private-registry>
-
Set the environment variable for the Kubernetes version from an internet-connected host by running the following command:
KBVER
: Retrieves the Kubernetes version from your cluster for compatibility with Portworx CSI.PXVER
: Specifies the required Portworx CSI version.
KBVER=$(oc version | awk -F'[v+_-]' '/Kubernetes/ {print $2}')
PXVER=<portworx-CSI-version> # e.g., 25.1.0 -
Download bootstrap script using the following command. It will download the specified Kubernetes and Portworx CSI versions that you have set previously. It helps you pull and prepare the container images required for installation.
curl -o px-ag-install.sh -L "https://install.portworx.com/$PXVER/air-gapped?kbver=$KBVER"
-
Pull required container images for your installation:
sh px-ag-install.sh pull
-
Authenticate a private registry that is accessible to your air-gapped nodes:
- login as an administrator
oc login -user admin -p <password> <your-private-registry>
- Log in to the registry:
Authenticate with the internal OpenShift image registry
docker
. For example:docker login --username <user-name> --password-stdin <password>
- login as an administrator
-
Push the container images to the OpenShift registry for use by the cluster.
sh px-ag-install.sh push <your-private-registry>
Configure Portworx version manifest
- Kubernetes
- OpenShift
-
Create a secret for the Portworx Operator to access the registry:
kubectl -n <portworx> create secret docker-registry px-image-repository \
--docker-server=image-registry.openshift-image-registry.svc:5000 \
--docker-username=admin \
--docker-password=$(oc whoami -t) -
Download the version manifest for your Portworx CSI installation:
curl -o versions.yaml "https://install.portworx.com/$PXVER/version?kbver=$KBVER"
-
Create a configmap from the downloaded manifest:
kubectl -n <portworx> create configmap px-versions --from-file=versions.yaml
-
Create a secret for the Portworx Operator to access the registry:
oc -n <portworx> create secret docker-registry px-image-repository \
--docker-server=image-registry.openshift-image-registry.svc:5000 \
--docker-username=admin \
--docker-password=$(oc whoami -t) -
Download the version manifest for your Portworx CSI installation:
curl -o versions.yaml "https://install.portworx.com/$PXVER/version?kbver=$KBVER"
-
Create a configmap from the downloaded manifest:
oc -n <portworx> create configmap px-versions --from-file=versions.yaml
Generate Kubernetes manifests
To generate manifests for Portworx CSI installation, follow these steps:
-
Navigate to Portworx Central and log in or create an account.
-
In the Welcome to Portworx! section, select Get Started.
-
On the Product Line page, in the PX-CSI section, select Continue.
-
On the Generate PX-CSI Spec page, review the options and select the appropriate values based on your requirements.
important- By default, iSCSI is set as your protocol for data transfer. To change this, use the Storage Area Network dropdown.
- For Vanilla Kubernetes cluster, select the Distribution Name option as None.
-
(Optional) If you are using the secure multi-tenancy feature in FlashArray, follow these steps in the Advanced Settings:
- Select Custom from the KVDB Device dropdown.
- Check the Enable multitenancy option.
- Enter the FlashArray pod name in the Pure FA Pod Name field.
important
If you are using multiple FlashArrays with the secure multi-tenancy feature, ensure that the pod names are the same across the realms.
-
Select the Use Custom registry checkbox in the Advanced Settings, and provide the following:
- Image Repository Location: Path of your private registry
- Registry Secret: Secret created in the previous section
-
(Optional) If you are using multiple NICs for the iSCSI host, add the environment variable
PURE_ISCSI_ALLOWED_IFACES
with comma-separated names of NICs in Advanced Settings. Example:"eth1,eth2"
.noteIf your virtual machine has multiple NICs, FlashArray cannot differentiate between those with iSCSI and those without. You must specify the list of NICs; otherwise, Portworx might only utilize one of the available interfaces.
-
Click Save and Download to generate the specification.
Apply Kubernetes manifests
Apply the Operator and StorageCluster specification you generated in the section above:
If you have modified the specification, use the filename in the kubectl apply
command instead of the specification URL generated from Portworx Central.
- Kubernetes
- OpenShift
-
Deploy the Operator:
kubectl apply -f '<url-generated-from-portworx-central-spec-gen>'
serviceaccount/portworx-operator created
podsecuritypolicy.policy/px-operator created
clusterrole.rbac.authorization.k8s.io/portworx-operator created
clusterrolebinding.rbac.authorization.k8s.io/portworx-operator created
deployment.apps/portworx-operator created -
Deploy the StorageCluster:
kubectl apply -f '<url-generated-from-portworx-central-spec-gen>'
storagecluster.core.libopenstorage.org/px-cluster-xxxxxxxx-xxxx-xxxx-xxxx-5db83030471e created
-
From the OpenShift UI, go to OperatorHub, search for Portworx, and click Install to deploy the Portworx Operator in a desired namespace. If you do not have access to the OperatorHub, run the following command to deploy the Portworx Operator:
oc apply -f 'https://install.portworx.com/<PXVER>?comp=pxoperator®=<your-private-registry>'
noteEnsure that you are deploying Operator version 24.2.1 or later.
-
Deploy the StorageCluster:
oc apply -f '<url-generated-from-portworx-central-spec-gen>'
storagecluster.core.libopenstorage.org/px-cluster-xxxxxxxx-xxxx-xxxx-xxxx-5db83030471e created
After deployment, Portworx CSI detects the presence of the FlashArray and FlashBlade secrets during startup and uses the specified FlashArray and FlashBlade for backend storage.
Verify Portworx installation
After installing Portworx CSI, verify the status of the Portworx cluster and pods to ensure everything is running correctly.
- Kubernetes
- OpenShift
- Verify that all Portworx pods are running.
kubectl get pods -n <portworx> -o wide | grep -e portworx -e px
- Check the status of the Portworx cluster.
pxctl status
- Verify the status of the Portworx cluster provision.
kubectl get stc -n <portworx>
- Verify that all Portworx pods are running.
oc get pods -n <portworx> -o wide | grep -e portworx -e px
- Check the status of the Portworx cluster.
pxctl status
- Verify the status of the Portworx cluster provision.
oc get stc -n <portworx>