Enter maintenance mode in Tanzu
This guide describes a recommended workflow for putting a Portworx node in maintenance mode in your Kubernetes cluster.
Step 1. Migrate application pods using Portworx volumes that are running on this node
Before putting Portworx in maintenance mode on a node, applications running on that node using Portworx need to be migrated. If Portworx is in maintenance mode, existing application pods will end up with read-only volumes and new pods will fail to start.
Perform the following steps to migrate select pods:
-
Cordon the node using:
kubectl cordon <node>
-
Delete the application pods using Portworx volumes using:
kubectl delete pod <pod-name>
Since application pods are expected to be managed by a controller like
Deployement
orStatefulSet
, Kubernetes will spin up a new replacement pod on another node.
Step 2. Enter maintenance mode
pxctl service maintenance --enter
This takes Portworx out of an “Operational” state for a given node. Perform whatever maintenance tasks are needed.
Step 3. Exit maintenance mode
Once you are done with maintenance tasks, run:
pxctl service maintenance --exit
This puts Portworx back in to “Operational” state for a given node.
Step 4. Uncordon the node
You can now uncordon the node using:
kubectl uncordon <node>