Maintenance without taking the service down,
data that stays.
Draining a node for maintenance does not take down all the copies at once, a recreated Pod uses the same volume again, and a release change can be reverted.
- Protections during maintenance
- Scenario: maintenance of a node with Trino workers
- Data that outlives the Pod
- Release rollback
Protections during maintenance
Draining a node for maintenance does not take down all copies at once.
The PodDisruptionBudget (PDB) limits how many Pods of an application can be down at the same time during voluntary evictions, such as the kubectl drain of a node for maintenance.
The drain waits for the PDB to allow each eviction instead of removing all replicas together.
The PDB applies to evictions made through the Eviction API, as in the drain. It does not limit reducing the number of replicas or deleting Pods directly.
Enabled by default, with workerPodDisruptionBudget.maxUnavailable: 1: at most one worker unavailable during voluntary disruptions, such as draining a node.
Created by Strimzi, with maxUnavailable: 1: at most one broker down at a time.
Created by the chart, one for the master and another for the workers, each with an empty maxUnavailable, which means 1: at most one Pod down at a time. The drain removes one worker at a time. The master is a single instance, and the budget allows the drain to remove it.
Created by the chart, with an empty maxUnavailable, which means 1: at most one Pod down at a time. In the default deployment, with a single instance, the budget allows the drain to remove the database Pod.
The TDP chart enables the integration with the Trino graceful shutdown API. The worker stops receiving tasks and waits for the running tasks to finish, within the configured period. This integration is used in drains, updates and scale-downs by the autoscaler.
Scenario: maintenance of a node with Trino workers
Situation: a node with two Trino workers goes into maintenance, with kubectl drain.
What TDP does: the Trino chart enables the workers PDB and graceful shutdown, with these default periods in the values file:
tdp-trino:
worker:
gracefulShutdown:
enabled: true
gracePeriodSeconds: 120 # Trino shutdown.grace-period
terminationGracePeriodSeconds: 300 # must be >= 2 x gracePeriodSeconds
workerPodDisruptionBudget:
enabled: true
maxUnavailable: 1
Effect: the drain removes one worker at a time, as long as the disruption budget allows it, and the replacement of each worker must find capacity on other nodes for the drain to proceed. An idle worker takes about twice the gracePeriodSeconds to stop. A busy worker can take up to the terminationGracePeriodSeconds, at the end of which it is terminated and the tasks still running on it fail. The two periods go together: the terminationGracePeriodSeconds must be at least twice the gracePeriodSeconds.
Strimzi already creates the PDB for the Kafka brokers.
A second PDB over the same Pods makes the Eviction API refuse all requests, which blocks kubectl drain.
Data that outlives the Pod
When a Pod is recreated, it uses the same volume again.
A PersistentVolumeClaim (PVC) reserves storage that exists independently of the Pod.
In the TDP charts, the components below offer persistence through PVCs. The size and the StorageClass are defined in the values. The storage must be available and accessible for a recreated Pod to reuse the data.
| Component | What is kept in the persistent volume |
|---|---|
| Kafka | Data and metadata of each broker. The PVC of a removed broker is kept. |
| ClickHouse | Database data. |
| Ozone | Datanode data blocks and Ozone Manager and SCM metadata, plus the S3 Gateway volume. |
| PostgreSQL | Metadata database, such as the Hive Metastore catalog. If this database is lost, the tables may no longer be found by name, even with the files preserved in storage. |
| Ranger | Audit in the dedicated Solr delivered by the TDP chart. |
| CloudBeaver | Application workspace. |
| JupyterHub | Hub database (SQLite) and each user's files. |
| Airflow | DAGs and triggerer logs. |
The volumes in the table let you recover data when a Pod is recreated. The effect of helm uninstall varies by component. See Uninstallation before cleaning up resources.
Release rollback
The configuration of each component is kept in the values applied in each release.
Rolling back a release change follows the deployment method:
Each installation and update records a release revision, listed by helm history. helm rollback returns the release to a previous revision.
The rollback is done in Git, by reverting the commit of the change. Argo CD synchronizes the cluster with the reverted state in the repository.
The rollback restores the release configuration.
Update and rollback procedures: Update via Helm and Rollback.
See also
Processes
Self-healing and operators
Probes and controllers recover the Pods. Operators maintain the declared state and what stays with the team.
Service and data
Replicas and distribution across nodes
Replicas and replicated data per component, and how the replicas are distributed across nodes.