// This assembly is included in the following assemblies:
//
// assembly-customizing-deployments.adoc

[id='con-customizing-template-properties-{context}']
= Template properties

You can use the `template` property to configure aspects of the resource creation process.
You can include it in the following resources and properties:

* `Kafka.spec.kafka`
* `Kafka.spec.zookeeper`
* `Kafka.spec.entityOperator`
* `Kafka.spec.kafkaExporter`
* `KafkaConnect.spec`
* `KafkaConnectS2I.spec`
* `KafkaMirrorMakerSpec`
* `KafkaBridge.spec`

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

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

== Supported template properties for a Kafka cluster

`statefulset`:: Configures the `StatefulSet` used by the Kafka broker.
`pod`:: Configures the Kafka broker `Pods` created by the `StatefulSet`.
`bootstrapService`:: Configures the bootstrap service used by clients running within Kubernetes to connect to the Kafka broker.
`brokersService`:: Configures the headless service.
`externalBootstrapService`:: Configures the bootstrap service used by clients connecting to Kafka brokers from outside of Kubernetes.
`perPodService`:: Configures the per-Pod services used by clients connecting to the Kafka broker from outside Kubernetes to access individual brokers.
`externalBootstrapRoute`:: Configures the bootstrap route used by clients connecting to the Kafka brokers from outside of OpenShift using OpenShift `Routes`.
`perPodRoute`:: Configures the per-Pod routes used by clients connecting to the Kafka broker from outside OpenShift to access individual brokers using OpenShift `Routes`.
`podDisruptionBudget`:: Configures the Pod Disruption Budget for Kafka broker `StatefulSet`.
`kafkaContainer`:: Configures the container used to run the Kafka broker, including custom environment variables.
`tlsSidecarContainer`:: Configures the TLS sidecar container, including custom environment variables.
`initContainer`:: Configures the container used to initialize the brokers.
`persistentVolumeClaim`:: Configures the metadata of the Kafka `PersistentVolumeClaims`.

.Additional resources

xref:type-KafkaClusterTemplate-reference[].

== Supported template properties for a ZooKeeper cluster

`statefulset`:: Configures the ZooKeeper `StatefulSet`.
`pod`:: Configures the ZooKeeper `Pods` created by the `StatefulSet`.
`clientsService`:: Configures the service used by clients to access ZooKeeper.
`nodesService`:: Configures the headless service.
`podDisruptionBudget`:: Configures the Pod Disruption Budget for ZooKeeper `StatefulSet`.
`zookeeperContainer`:: Configures the container used to run the ZooKeeper Node, including custom environment variables.
`tlsSidecarContainer`:: Configures the TLS sidecar container, including custom environment variables.
`persistentVolumeClaim`:: Configures the metadata of the ZooKeeper `PersistentVolumeClaims`.

.Additional resources

xref:type-ZookeeperClusterTemplate-reference[].

== Supported template properties for Entity Operator

`deployment`:: Configures the Deployment used by the Entity Operator.
`pod`:: Configures the Entity Operator `Pod` created by the `Deployment`.
`topicOperatorContainer`:: Configures the container used to run the Topic Operator, including custom environment variables.
`userOperatorContainer`:: Configures the container used to run the User Operator, including custom environment variables.
`tlsSidecarContainer`:: Configures the TLS sidecar container, including custom environment variables.

.Additional resources

xref:type-EntityOperatorTemplate-reference[].

== Supported template properties for Kafka Exporter

`deployment`:: Configures the Deployment used by Kafka Exporter.
`pod`:: Configures the Kafka Exporter `Pod` created by the `Deployment`.
`services`:: Configures the Kafka Exporter services.
`container`:: Configures the container used to run Kafka Exporter, including custom environment variables.

.Additional resources

xref:type-KafkaExporterTemplate-reference[].

== Supported template properties for Kafka Connect and Kafka Connect with Source2Image support

`deployment`:: Configures the Kafka Connect `Deployment`.
`pod`:: Configures the Kafka Connect `Pods` created by the `Deployment`.
`apiService`:: Configures the service used by the Kafka Connect REST API.
`podDisruptionBudget`:: Configures the Pod Disruption Budget for Kafka Connect `Deployment`.
`connectContainer`:: Configures the container used to run Kafka Connect, including custom environment variables.

.Additional resources

xref:type-KafkaConnectTemplate-reference[].

== Supported template properties for Kafka MirrorMaker

`deployment`:: Configures the Kafka MirrorMaker `Deployment`.
`pod`:: Configures the Kafka MirrorMaker `Pods` created by the `Deployment`.
`podDisruptionBudget`:: Configures the Pod Disruption Budget for Kafka MirrorMaker `Deployment`.
`mirrorMakerContainer`:: Configures the container used to run Kafka MirrorMaker, including custom environment variables.

.Additional resources

xref:type-KafkaMirrorMakerTemplate-reference[].
