// This assembly is included in the following assemblies:
//
// assembly-deployment-configuration.adoc

[id='assembly-customizing-kubernetes-resources-{context}']
= Customizing Kubernetes resources

[role="_abstract"]
A Strimzi deployment creates Kubernetes resources, such as `Deployment`, `Pod`, and `Service` resources.
These resources are managed by Strimzi operators.
Only the operator that is responsible for managing a particular Kubernetes resource can change that resource.
If you try to manually change an operator-managed Kubernetes resource, the operator will revert your changes back.

Changing an operator-managed Kubernetes resource can be useful if you want to perform certain tasks, such as the following:

- Adding custom labels or annotations that control how `Pods` are treated by Istio or other services
- Managing how `Loadbalancer`-type Services are created by the cluster

To make the changes to a Kubernetes resource, you can use the `template` property within the `spec` section of various Strimzi custom resources. 

Here is a list of the custom resources where you can apply the changes:

* `Kafka.spec.kafka`
* `Kafka.spec.zookeeper`
* `Kafka.spec.entityOperator`
* `Kafka.spec.kafkaExporter`
* `Kafka.spec.cruiseControl`
* `KafkaNodePool.spec`
* `KafkaConnect.spec`
* `KafkaMirrorMaker.spec`
* `KafkaMirrorMaker2.spec`
* `KafkaBridge.spec`
* `KafkaUser.spec`

For more information about these properties, see the link:{BookURLConfiguring}[Strimzi Custom Resource API Reference^].

The Strimzi Custom Resource API Reference provides more details about the customizable fields.

In the following example, the `template` property is used to modify the labels in a Kafka broker's pod.

.Example template customization
[source,yaml,subs=attributes+]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
  labels:
    app: my-cluster
spec:
  kafka:
    # ...
    template:
      pod:
        metadata:
          labels:
            mylabel: myvalue
    # ...
----

include::../../modules/configuring/con-customizing-image-pull-policy.adoc[leveloffset=+1]
include::../../modules/configuring/con-applying-termination-grace-period.adoc[leveloffset=+1]
