// Module included in the following assemblies:
//
// managing/assembly-rolling-updates.adoc

[id='proc-manual-rolling-update-pods-{context}']
= Performing a rolling update using a Pod annotation

This procedure describes how to manually trigger a rolling update of an existing Kafka cluster or ZooKeeper cluster using a Kubernetes `Pod` annotation.
When multiple pods from the same `StatefulSet` are annotated, consecutive rolling updates are performed within the same reconciliation run.

.Prerequisites

You can perform a rolling update on a Kafka cluster regardless of the topic replication factor used.
But for Kafka to stay operational during the update, you'll need the following:

* A highly available Kafka cluster deployment running with nodes that you wish to update.
* Topics replicated for high availability.
+
Topic configuration specifies a replication factor of at least 3 and a minimum number of in-sync replicas to 1 less than the replication factor.
+
.Kafka topic replicated for high availability
[source,yaml,subs="attributes+"]
----
apiVersion: {KafkaTopicApiVersion}
kind: KafkaTopic
metadata:
  name: my-topic
  labels:
    strimzi.io/cluster: my-cluster
spec:
  partitions: 1
  replicas: 3
  config:
    # ...
    min.insync.replicas: 2
    # ...
----

.Procedure

. Find the name of the Kafka or ZooKeeper `Pod` you want to manually update.
+
For example, if your Kafka cluster is named _my-cluster_, the corresponding `Pod` names are _my-cluster-kafka-index_ and _my-cluster-zookeeper-index_.
The _index_ starts at zero and ends at the total number of replicas minus one.

. Annotate the `Pod` resource in Kubernetes.
+
Use `kubectl annotate`:
+
[source,shell,subs=+quotes]
----
kubectl annotate pod _cluster-name_-kafka-_index_ strimzi.io/manual-rolling-update=true

kubectl annotate pod _cluster-name_-zookeeper-_index_ strimzi.io/manual-rolling-update=true
----

. Wait for the next reconciliation to occur (every two minutes by default).
A rolling update of the annotated `Pod` is triggered, as long as the annotation was detected by the reconciliation process.
When the rolling update of a pod is complete, the annotation is removed from the `Pod`.
