// 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 `Deployments`, `StatefulSets`, `Pods`, and `Services`.
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:

- 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

You can make the changes using the `template` property in the Strimzi custom resources.
The `template` property is supported in the following resources.
The API reference provides more details about the customizable fields.

`Kafka.spec.kafka`:: See xref:type-KafkaClusterTemplate-reference[]
`Kafka.spec.zookeeper`:: See xref:type-ZookeeperClusterTemplate-reference[]
`Kafka.spec.entityOperator`:: See xref:type-EntityOperatorTemplate-reference[]
`Kafka.spec.kafkaExporter`:: See xref:type-KafkaExporterTemplate-reference[]
`Kafka.spec.cruiseControl`:: See xref:type-CruiseControlTemplate-reference[]
`Kafka.spec.jmxTrans`:: See xref:type-JmxTransTemplate-reference[]
`KafkaConnect.spec`:: See xref:type-KafkaConnectTemplate-reference[]
`KafkaMirrorMaker.spec`:: See xref:type-KafkaMirrorMakerTemplate-reference[]
`KafkaMirrorMaker2.spec`:: See xref:type-KafkaConnectTemplate-reference[]
`KafkaBridge.spec`:: See xref:type-KafkaBridgeTemplate-reference[]
`KafkaUser.spec`:: See xref:type-KafkaUserTemplate-reference[]

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

.Example template customization
[source,yaml,subs=attributes+]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
  labels:
    app: my-cluster
spec:
  kafka:
    # ...
    template:
      statefulset:
        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]
