Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(refactor): moves drain cleaner content #9647

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
// This assembly is included in the following assemblies:
//
// assembly-management-tasks.adoc
// main deploying file

[id='assembly-drain-cleaner-{context}']
= Evicting pods with the Strimzi Drain Cleaner

[role="_abstract"]
Kafka and ZooKeeper pods might be evicted during Kubernetes upgrades, maintenance, or pod rescheduling.
If your Kafka broker and ZooKeeper pods were deployed by Strimzi, you can use the Strimzi Drain Cleaner tool to handle the pod evictions.
If your Kafka and ZooKeeper pods were deployed by Strimzi, you can use the Strimzi Drain Cleaner tool to handle the pod evictions.
The Strimzi Drain Cleaner handles the eviction instead of Kubernetes.
You must set the `podDisruptionBudget` for your Kafka deployment to `0` (zero).
Kubernetes will then no longer be allowed to evict the pod automatically.

To use the Strimzi Drain Cleaner, you must set the `podDisruptionBudget` for your Kafka deployment to `0` (zero) so that Kubernetes is no longer allowed to evict pods automatically.

By deploying the Strimzi Drain Cleaner, you can use the Cluster Operator to move Kafka pods instead of Kubernetes.
The Cluster Operator ensures that topics are never under-replicated.
Kafka can remain operational during the eviction process.
The Cluster Operator ensures that topics are never under-replicated and Kafka can remain operational during the eviction process.
The Cluster Operator waits for topics to synchronize, as the Kubernetes worker nodes drain consecutively.

An admission webhook notifies the Strimzi Drain Cleaner of pod eviction requests to the Kubernetes API.
Expand Down Expand Up @@ -68,16 +67,16 @@ To deploy and use the Strimzi Drain Cleaner, you need to download the deployment
The Strimzi Drain Cleaner deployment files are available from the link:{ReleaseDownload}.

//steps for deploying drain cleaner
include::../../modules/managing/proc-drain-cleaner-deploying.adoc[leveloffset=+1]
include::../../modules/drain-cleaner/proc-drain-cleaner-deploying.adoc[leveloffset=+1]
ifdef::Section[]
//deploy using Helm
include::../../modules/managing/proc-drain-cleaner-deploying-helm-chart.adoc[leveloffset=+1]
include::../../modules/drain-cleaner/proc-drain-cleaner-deploying-helm-chart.adoc[leveloffset=+1]
endif::Section[]
//steps for using drain cleaner
include::../../modules/managing/proc-drain-cleaner-using.adoc[leveloffset=+1]
include::../../modules/drain-cleaner/proc-drain-cleaner-using.adoc[leveloffset=+1]
ifdef::Section[]
//generate tls certificates when deploying on Kubernetes
include::../../modules/managing/proc-drain-cleaner-certs.adoc[leveloffset=+1]
include::../../modules/drain-cleaner/proc-drain-cleaner-certs.adoc[leveloffset=+1]
endif::Section[]
//watching TLS certs renewals
include::../../modules/managing/proc-drain-cleaner-certs-renewals.adoc[leveloffset=+1]
include::../../modules/drain-cleaner/proc-drain-cleaner-certs-renewals.adoc[leveloffset=+1]
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ include::../../modules/managing/proc-pausing-reconciliation.adoc[leveloffset=+1]
//windows (time) for maintenance
include::assembly-maintenance-time-windows.adoc[leveloffset=+1]

//using drain cleaner to drain pods
include::assembly-drain-cleaner.adoc[leveloffset=+1]

//steps to delete kafka nodes using annotations
include::../../modules/configuring/proc-manual-delete-pod-pvc-kafka.adoc[leveloffset=+1]

Expand Down
2 changes: 2 additions & 0 deletions documentation/deploying/deploying.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ include::assemblies/configuring/assembly-reassign-tool.adoc[leveloffset=+1]
include::assemblies/metrics/assembly-metrics.adoc[leveloffset=+1]
//Introduce tracing to your deployment
include::assemblies/tracing/assembly-distributed-tracing.adoc[leveloffset=+1]
//using drain cleaner to drain pods
include::assemblies/deploying/assembly-drain-cleaner.adoc[leveloffset=+1]
//Upgrading the deployment
include::assemblies/upgrading/assembly-upgrade.adoc[leveloffset=+1]
//Downgrading the deployment
Expand Down
26 changes: 11 additions & 15 deletions documentation/modules/upgrading/con-upgrade-cluster.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,12 @@ In a highly available environment, the Cluster Operator maintains a minimum numb

== Rolling pods using the Strimzi Drain Cleaner

You can use the xref:assembly-drain-cleaner-{context}[Strimzi Drain Cleaner] to evict nodes during an upgrade.
The Strimzi Drain Cleaner annotates pods with a rolling update pod annotation.
This informs the Cluster Operator to perform a rolling update of an evicted pod.
When using the Strimzi Drain Cleaner to evict nodes during upgrade, it annotates pods with a rolling update pod annotation to inform the Cluster Operator to perform a rolling update of an evicted pod.
PaulRMellor marked this conversation as resolved.
Show resolved Hide resolved

A pod disruption budget allows only a specified number of pods to be unavailable at a given time.
During planned maintenance of Kafka broker pods, a pod disruption budget ensures Kafka continues to run in a highly available environment.

You specify a pod disruption budget using a `template` customization for a Kafka component.
By default, pod disruption budgets allow only a single pod to be unavailable at a given time.

In order to use the Drain Cleaner to roll pods, you set `maxUnavailable` to `0` (zero).
Reducing the pod disruption budget to zero prevents voluntary disruptions, so pods must be evicted manually.
A pod disruption budget limits the number of unavailable pods and ensures Kafka's availability during planned maintenance.
By default, the budget permits only one pod to be unavailable at a given time.
To be able to use the Drain Cleaner to roll Kafka pods, you must set `maxUnavailable` to `0` (zero) in the template configuration of the `Kafka` resource.
Reducing the pod disruption budget to zero prevents Kubernetes from evicting pods automatically, so pods must be evicted through Strimzi Drain Cleaner.

.Specifying a pod disruption budget
[source,yaml,subs=attributes+]
Expand All @@ -77,6 +71,8 @@ spec:
# ...
----

For more information, see xref:assembly-drain-cleaner-{context}[].

== Rolling pods manually while keeping topics available

During an upgrade, you can trigger a manual rolling update of pods through the Cluster Operator.
Expand All @@ -89,13 +85,13 @@ You then add a pod annotation to make the update.
Here, the annotation updates a Kafka broker.

.Performing a manual rolling update on a Kafka broker pod
[source,shell,subs="+quotes,attributes"]
[source,shell,subs="+quotes"]
----
kubectl annotate pod _<cluster_name>_-kafka-_<index>_ strimzi.io/manual-rolling-update=true
kubectl annotate pod <cluster_name>-kafka-<index> strimzi.io/manual-rolling-update=true
----

You replace _<cluster_name>_ with the name of the cluster.
Kafka broker pods are named _<cluster-name>_-kafka-_<index>_, where _<index>_ starts at zero and ends at the total number of replicas minus one.
You replace <cluster_name> with the name of the cluster.
Kafka broker pods are named <cluster-name>-kafka-<index>, where <index> starts at zero and ends at the total number of replicas minus one.
For example, `my-cluster-kafka-0`.

[role="_additional-resources"]
Expand Down