// Module included in the following assemblies:
//
// assembly-management-tasks.adoc

[id='proc-pausing-reconciliation-{context}']

= Pausing reconciliation of custom resources using annotations

Sometimes it is useful to pause the reconciliation of custom resources managed by Strimzi operators,
so that you can perform fixes or make updates.
If reconciliations are paused, any changes made to custom resources are ignored by the operators until the pause ends.

If you want to pause reconciliation of a custom resource, set the `strimzi.io/pause-reconciliation` annotation to `true` in its configuration.
This instructs the appropriate operator to pause reconciliation of the custom resource.
For example, you can apply the annotation to the `KafkaConnect` resource so that reconciliation by the Cluster Operator is paused.

You can also create a custom resource with the pause annotation enabled.
The custom resource is created, but it is ignored.

.Prerequisites

* The Strimzi Operator that manages the custom resource is running.

.Procedure

. Annotate the custom resource in Kubernetes, setting `pause-reconciliation` to `true`:
+
[source,shell,subs="+quotes"]
----
kubectl annotate <kind_of_custom_resource> <name_of_custom_resource> strimzi.io/pause-reconciliation="true"
----
+
For example, for the `KafkaConnect` custom resource:
+
[source,shell,subs="+quotes"]
----
kubectl annotate KafkaConnect my-connect strimzi.io/pause-reconciliation="true"
----

. Check that the status conditions of the custom resource show a change to `ReconciliationPaused`:
+
[source,shell,subs="+quotes"]
----
kubectl describe <kind_of_custom_resource> <name_of_custom_resource>
----
+
The `type` condition changes to `ReconciliationPaused` at the `lastTransitionTime`.
+
.Example custom resource with a paused reconciliation condition type
[source,shell,subs="+attributes"]
----
apiVersion: {KafkaConnectApiVersion}
kind: KafkaConnect
metadata:
  annotations:
    strimzi.io/pause-reconciliation: "true"
    strimzi.io/use-connector-resources: "true"
  creationTimestamp: 2021-03-12T10:47:11Z
  #...
spec:
  # ...
status:
  conditions:
  - lastTransitionTime: 2021-03-12T10:47:41.689249Z
    status: "True"
    type: ReconciliationPaused
----

.Resuming from pause

* To resume reconciliation, you can set the annotation to `false`, or remove the annotation.

[role="_additional-resources"]
.Additional resources

* xref:con-custom-resources-status-str[Finding the status of a custom resource]
