<commit_before>// Module included in the following assemblies:
//
// assembly-evaluation.adoc

[id='proc-kafka-cluster-{context}']
= Creating a cluster

With Strimzi installed, you create a Kafka cluster, then a topic within the cluster.

When you create a cluster, the Cluster Operator you deployed when installing Strimzi watches for new Kafka resources.

.Prerequisites

* For the Kafka cluster, ensure a Cluster Operator is deployed.
* For the topic, you must have a running Kafka cluster.

.Procedure

. Log in to the Kubernetes cluster as a non-privileged user.

. Create a new `my-cluster` Kafka cluster with one ZooKeeper and one Kafka broker.
+
* Use `persistent-claim` storage
* Expose the Kafka cluster outside of the Kubernetes cluster using an external listener configured to use a `nodeport`.
+
--
[source,yaml,subs=attributes+]
----
cat << EOF | kubectl create -n my-kafka-project -f -
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    replicas: 1
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
      - name: tls
        port: 9093
        type: internal
        tls: true
        authentication:
          type: tls
      - name: external
        port: 9094
        type: nodeport
        tls: false
    storage:
      type: jbod
      volumes:
      - id: 0
        type: persistent-claim
        size: 100Gi
        deleteClaim: false
    config:
      offsets.topic.replication.factor: 3
      transaction.state.log.replication.factor: 3
      transaction.state.log.min.isr: 2
  zookeeper:
    replicas: 1
    storage:
      type: persistent-claim
      size: 100Gi
      deleteClaim: false
  entityOperator:
    topicOperator: {}
    userOperator: {}
EOF
----
--

. Wait for the cluster to be deployed:
+
[source,shell,subs="attributes+"]<commit_msg>Fix the offset and transaction state topic configurations in Quickstart book - Closes #5400 (#5401)<commit_after>// Module included in the following assemblies:
//
// assembly-evaluation.adoc

[id='proc-kafka-cluster-{context}']
= Creating a cluster

With Strimzi installed, you create a Kafka cluster, then a topic within the cluster.

When you create a cluster, the Cluster Operator you deployed when installing Strimzi watches for new Kafka resources.

.Prerequisites

* For the Kafka cluster, ensure a Cluster Operator is deployed.
* For the topic, you must have a running Kafka cluster.

.Procedure

. Log in to the Kubernetes cluster as a non-privileged user.

. Create a new `my-cluster` Kafka cluster with one ZooKeeper and one Kafka broker.
+
* Use `persistent-claim` storage
* Expose the Kafka cluster outside of the Kubernetes cluster using an external listener configured to use a `nodeport`.
+
--
[source,yaml,subs=attributes+]
----
cat << EOF | kubectl create -n my-kafka-project -f -
apiVersion: {KafkaApiVersion}
kind: Kafka
metadata:
  name: my-cluster
spec:
  kafka:
    replicas: 1
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
      - name: tls
        port: 9093
        type: internal
        tls: true
        authentication:
          type: tls
      - name: external
        port: 9094
        type: nodeport
        tls: false
    storage:
      type: jbod
      volumes:
      - id: 0
        type: persistent-claim
        size: 100Gi
        deleteClaim: false
    config:
      offsets.topic.replication.factor: 1
      transaction.state.log.replication.factor: 1
      transaction.state.log.min.isr: 1
  zookeeper:
    replicas: 1
    storage:
      type: persistent-claim
      size: 100Gi
      deleteClaim: false
  entityOperator:
    topicOperator: {}
    userOperator: {}
EOF
----
--

. Wait for the cluster to be deployed:
+
[source,shell,subs="attributes+"]
{'fraction_non_alphanumeric': 0.08385909568874869, 'fraction_numerical': 0.014721345951629864, 'mean_word_length': 2.6100569259962048, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5325267', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1120, 'n_words': 408}