Upgrade Portworx CSI
Modify the StorageCluster
spec to upgrade or change the Portworx CSI version at any time. The Portworx Operator manages the upgrade process automatically without user intervention. When Portworx upgrades, the Operator also updates installed components to the recommended version.
Prerequisites
Before upgrading, ensure the following requirements are met:
-
Verify that your Kubernetes cluster has sufficient CPU, memory, and storage resources. For more information, see System requirements.
-
Confirm that the cluster is in a healthy state before upgrading. Run the following commands to verify the cluster status:
PX_POD=$(kubectl get pods -l name=portworx -n <portworx> -o jsonpath='{.items[0].metadata.name}')
kubectl exec $PX_POD -n <portworx> -- /opt/pwx/bin/pxctl status
kubectl get pods -n <portworx>Ensure that:
- No nodes or pools are under maintenance.
- No nodes are decommissioned.
- No pods have
px/service=stop
label. - All Portworx pods are in the
Running
state before proceeding with the upgrade.
Upgrade the Portworx Operator
Before upgrading the StorageCluster
, Portworx by Pure Storage recommends upgrading the Operator to the latest version. The Operator is responsible for managing the lifecycle of Portworx components. Follow these steps to upgrade the Portworx Operator:
-
Retrieve the current version of the Portworx Operator:
kubectl get deployment -n <portworx> portworx-operator -o=jsonpath='{.spec.template.spec.containers[0].image}' && echo
-
Modify the
spec.image
field in the Portworx Operator deployment resource to update the image version:kubectl edit deployment -n <portworx> portworx-operator
Find the following section:
spec:
template:
spec:
containers:
- name: portworx-operator
image: portworx/px-operator:<current-version>Replace
<current-version>
with<latest-version>
, apply the changes, and confirm the update. -
Verify the rollout status to ensure the update is applied successfully:
kubectl rollout status deployment/portworx-operator -n <portworx>
Ensure that the deployment completes successfully before proceeding with the
StorageCluster
upgrade.
Upgrade the StorageCluster
-
Retrieve the name of your Portworx
StorageCluster
:kubectl get storagecluster -n <portworx>
NAME CLUSTER UUID STATUS VERSION AGE
px-cluster-test *****-****-****-**** Running <current-version> 4d -
Modify the
spec.image
field in theStorageCluster
resource to update the image version:kubectl edit storagecluster -n <portworx> <px-cluster-test>
Find the following section:
apiVersion: core.libopenstorage.org/v1
kind: StorageCluster
metadata:
name: px-cluster-test
namespace: <portworx>
spec:
image: portworx/oci-monitor:<desired-version>Replace
<desired-version>
with the target Portworx version and save the changes. -
Verify the upgrade:
kubectl get pods -n <portworx> -l name=portworx
kubectl get storagecluster -n <portworx>noteYou can also check the upgrade status of nodes at any time by running
kubectl get storagenodes -A
, which shows which nodes have been upgraded and the node currently being upgraded.After a successful upgrade, ensure all Portworx pods are running and verify the new version.
Troubleshooting
If the upgrade does not complete successfully, check the Portworx Operator logs for potential issues:
kubectl logs -n <portworx> deployment/portworx-operator