// Module included in the following assemblies:
//
// assembly-kafka-rack.adoc

[id='proc-configuring-init-container-image-{context}']
= Configuring init container image for Kafka rack awareness

When the Kafka rack feature is enabled, Kafka broker pods will use init container which will collect the labels from the Kubernetes cluster nodes.
The container image which will be used for this container can be configured using the `brokerRackInitImage` property in `Kafka.spec.kafka`.
When the `brokerRackInitImage` field is missing, the following images will be used (in the order of priority):

. Container image specified in `STRIMZI_DEFAULT_KAFKA_INIT_IMAGE` environment variable in Cluster Operator configuration.
. `{DockerKafkaInit}` container image.

WARNING: Overriding container images is recommended only in situations where you need to use a different container registry.
For example, if your network does not allow access to the container repository used by {ProductName}, you should either copy the {ProductName} images or build them from source.
In situations where the configured image is not compatible with {ProductName} images, this might not work properly.

.Prerequisites

* A Kubernetes cluster
* A running Cluster Operator

.Procedure

. Edit the `brokerRackInitImage` property in `Kafka.spec.kafka`.
+
[source,yaml,subs=attributes+]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    # ...
    brokerRackInitImage: my-org/my-image:latest
    # ...
----

. Create or update the resource.
+
This can be done using `kubectl apply`:
[source,shell,subs=+quotes]
kubectl apply -f _your-file_
