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

[id='proc-configuring-kafka-brokers-{context}']
= Configuring Kafka brokers

You can configure an existing Kafka broker, or create a new Kafka broker with a specified configuration.

.Prerequisites

* A Kubernetes cluster is available.
* The Cluster Operator is running.

.Procedure

. Open the YAML configuration file that contains the `Kafka` resource specifying the cluster deployment.

. In the `spec.kafka.config` property in the `Kafka` resource, enter one or more Kafka configuration settings. For example:
+
[source,yaml,subs=attributes+]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
spec:
  kafka:
    # ...
    config:
      default.replication.factor: 3
      offsets.topic.replication.factor: 3
      transaction.state.log.replication.factor: 3
      transaction.state.log.min.isr: 1
    # ...
  zookeeper:
    # ...
----

. Apply the new configuration to create or update the resource.
+
Use `kubectl apply`:
[source,shell,subs=+quotes]
kubectl apply -f _kafka.yaml_
+
where `_kafka.yaml_` is the YAML configuration file for the resource that you want to configure; for example, `kafka-persistent.yaml`.
