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

[id='con-customizing-containers-{context}']
= Customizing containers with environment variables

You can set custom environment variables for a container by using the relevant `template` container property. 
The following table lists the {ProductName} containers and the relevant template configuration property (defined under `spec`) for each custom resource.

.Table Container environment variable properties
|===
|{ProductName} Element |Container |Configuration property

|Kafka 
|Kafka Broker 
|`kafka.template.kafkaContainer.env`

|Kafka 
|Kafka Broker TLS Sidecar
|`kafka.template.tlsSidecarContainer.env`

|Kafka 
|Kafka Initialization
|`kafka.template.initContainer.env`

|Kafka
|ZooKeeper Node
|`zookeeper.template.zookeeperContainer.env`

|Kafka
|ZooKeeper TLS Sidecar
|`zookeeper.template.tlsSidecarContainer.env`

|Kafka
|Topic Operator
|`entityOperator.template.topicOperatorContainer.env`

|Kafka
|User Operator
|`entityOperator.template.userOperatorContainer.env`

|Kafka
|Entity Operator TLS Sidecar
|`entityOperator.template.tlsSidecarContainer.env`

|KafkaConnect
|Connect and ConnectS2I
|`template.connectContainer.env`

|KafkaMirrorMaker
|MirrorMaker 
|`template.mirrorMakerContainer.env`

|KafkaBridge
|Bridge
|`template.bridgeContainer.env`
|===

The environment variables are defined under the `env` property as a list of objects with `name` and `value` fields. 
The following example shows two custom environment variables set for the Kafka broker containers:

[source,yaml,subs=attributes+]
----
# ...
kind: Kafka
spec:
    kafka:
        template:
            kafkaContainer:
                env:
                    - name: TEST_ENV_1
                      value: test.env.one
                    - name: TEST_ENV_2
                      value: test.env.two
# ...
----

Environment variables prefixed with `KAFKA_` are internal to {ProductName} and should be avoided.
If you set a custom environment variable that is already in use by {ProductName}, it is ignored and a warning is recorded in the log.

.Additional resources

* For more information, see xref:type-ContainerTemplate-reference[].
