Skip to main content

Pods that come back on their own,
state that is kept.

Kubernetes notices a container with a problem and acts on its own, and the Kafka, ClickHouse, and NiFi operators reconcile the resources they manage until the environment matches the declared state.

Self-healing​

Kubernetes notices a container with a problem and acts on its own.

Probes, when configured, are periodic checks that Kubernetes performs on the containers.

The liveness probe can detect a container that stopped responding and trigger its restart.

The readiness probe signals whether the Pod is ready and removes it from the ready endpoints of the Services while the check fails.

The startup probe gives slow initializations time to complete before liveness and readiness take effect.

In addition, Kubernetes controllers recreate lost Pods to keep the declared number of replicas.

Recovering a Pod is not the same as keeping the service available: while it restarts, the service may be unavailable, especially in components with a single instance, such as the Trino coordinator.

Liveness and readiness

Airflow, CloudBeaver, Kafka (brokers), NiFi, OpenMetadata, Superset and Spark History Server ship with the probes defined.

Startup

Airflow, OpenMetadata, Superset and PostgreSQL use the startup probe to protect initialization.

Adjustable timings

The initial delay, interval, timeout and failure threshold of each probe are defined in the component values file.

Scenario: cold start of the Kafka cluster​

Situation: after a full shutdown, the Kafka nodes defined in nodePool.replicas start together, recover their logs and form the metadata quorum.

In the TDP default profile, each node takes on both the broker and controller roles.

What TDP does: the Kafka chart defines probes that are more tolerant than the Strimzi defaults, with these values:

values.yaml (excerpt)
probes:
liveness:
initialDelaySeconds: 60
timeoutSeconds: 30
periodSeconds: 30
failureThreshold: 10
readiness:
initialDelaySeconds: 60
timeoutSeconds: 30
periodSeconds: 30
failureThreshold: 10

Effect: the brokers have time to recover their logs and form the quorum before the probes trigger a restart.

caution

Reduce these values only after testing a cold start of the entire Kafka cluster.

Stricter probes can restart the brokers before the quorum forms.

Operators maintain the declared state​

The cluster is described in a Kubernetes resource, and the operator reconciles the resources it manages.

In the TDP Kubernetes deployment, Kafka, ClickHouse and NiFi are declared as custom resources and managed by the operators below. These projects can also be deployed through other mechanisms. The TDP guides follow this integration.

The operator of each one watches the resource and creates, recreates and updates Pods, Services and volumes until the environment matches what was declared.

Kafka

Strimzi

Manages brokers, topics and users. During updates, it restarts the brokers one at a time.

ClickHouse

Altinity ClickHouse Operator

Reconciles the ClickHouseInstallation, with shards, replicas, volumes and cluster configuration.

NiFi

NiFiKop

Creates, monitors and updates the NiFi nodes declared in the NifiCluster.

Resources managed by each operator

What the operator does and what stays with the team​

The operator keeps the environment consistent with the declared resource.

The desired state is declared by the team that operates the environment.

ActivityWho handles itIn TDP Kubernetes
ProvisionOperatorFrom the declared resource, the operator creates Pods, Services and volumes: Strimzi for Kafka, KafkaTopic and KafkaUser; the Altinity ClickHouse Operator for ClickHouseInstallation and ClickHouseKeeperInstallation; NiFiKop for the NifiCluster nodes.
UpdateOperatorA change to the resource is applied by the operator. In Kafka, Strimzi restarts the brokers one at a time.
Recreate PodsOperatorWhen a managed Pod is lost, the operator recreates it so that the environment matches the declared state again.
Reconcile the configurationOperatorThe Altinity ClickHouse Operator reconciles the shards, replicas, volumes and configuration declared in the ClickHouseInstallation. In NiFi, administrators and readers can be maintained declaratively by NiFiKop (nifiCluster.authorization).
Declare the desired stateTeamReplicas, resources and configuration are kept in the chart values file, applied with Helm or by Argo CD.
How to roll back a release change

See also​