Skip to main content

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​

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.

Trino: workers PDB

Enabled by default, with workerPodDisruptionBudget.maxUnavailable: 1: at most one worker unavailable during voluntary disruptions, such as draining a node.

Kafka: brokers PDB

Created by Strimzi, with maxUnavailable: 1: at most one broker down at a time.

Spark: master and workers PDBs

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.

PostgreSQL: primary instance PDB

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.

Trino: graceful shutdown

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.

How Trino workers leave the cluster while finishing their tasksDuring node maintenance, kubectl drain requests the eviction of the workers and the PodDisruptionBudget releases one worker at a time. In a scale-down by the HPA or KEDA, the Pod is removed directly, bypassing the PodDisruptionBudget. In both cases the worker goes through graceful shutdown: it stops accepting tasks, finishes the ones in progress within the configured deadline, and only then stops.NODE MAINTENANCESCALE-DOWN BY AUTOSCALINGkubectl drainrequests Pod evictionPodDisruptionBudgetreleases one worker at a timeHPA or KEDAreduces the replicasTrino workergraceful shutdownstops accepting tasksand finishes the ones it hasTaskscompletedwithin the deadline
Figure 1 - PDB and graceful shutdown in the Trino workers integration delivered by TDP Kubernetes

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:

values.yaml (excerpt)
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.

One PDB per set of Pods

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.

ComponentWhat is kept in the persistent volume
KafkaData and metadata of each broker. The PVC of a removed broker is kept.
ClickHouseDatabase data.
OzoneDatanode data blocks and Ozone Manager and SCM metadata, plus the S3 Gateway volume.
PostgreSQLMetadata 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.
RangerAudit in the dedicated Solr delivered by the TDP chart.
CloudBeaverApplication workspace.
JupyterHubHub database (SQLite) and each user's files.
AirflowDAGs 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:

Helm

Each installation and update records a release revision, listed by helm history. helm rollback returns the release to a previous revision.

Argo CD

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

Update and rollback procedures: Update via Helm and Rollback.

See also​