OpsChain workers
When performing maintenance on MintPress, we recommend stopping the OpsChain workers before you bring down the rest of the stack. This will ensure that any in-progress actions are allowed to complete, but no new actions will be started.
During this period, the API will still be available, allowing the status of changes to be queried, and new changes to be enqueued which will be actioned once the workers are bought back into service.
Graceful shutdown
When worker pods are signalled to stop, they will wait up to one hour by default for any in-progress actions to complete before being forcefully terminated.
If you have actions that may take longer than one hour to complete, you can customise this grace period by setting the apiWorker.terminationGracePeriodSeconds Helm value in your values.yaml file and redeploying MintPress with the command used for patching.
This reconfiguration will only apply to actions started within the newly started worker instances. Any in-progress actions running when this value is applied will be subject to the previous grace period.
Performing maintenance
MintPress provides a script to help with starting and stopping all MintPress resources. Refer to the start and stopping MintPress guide for more information.
If you prefer to manually scale down only the workers, follow the steps below:
# record your current number of worker replicas
REPLICAS=$(kubectl get deploy opschain-api-worker -o jsonpath='{.spec.replicas}')
# scale the workers to zero
kubectl scale deploy opschain-api-worker --replicas=0
# wait for all workers to exit
# if you have customised the grace period, substitute the timeout value to match
kubectl wait --for=delete pod -l app=opschain-api-worker --timeout=1h
# PERFORM MAINTENANCE
# scale your workers back up to the original number of replicas
kubectl scale deploy opschain-api-worker --replicas $REPLICAS