// This assembly is included in the following assemblies:
//
// getting-started.adoc

// Save the context of the assembly that is including this one.
// This is necessary for including assemblies in assemblies.
// See also the complementary step on the last line of this file.

[id='kafka-cluster-{context}']
= Kafka cluster

You can use {ProductName} to deploy an ephemeral or persistent Kafka cluster to {ProductPlatformName}. When installing Kafka, {ProductName} also installs a Zookeeper cluster and adds the necessary configuration to connect Kafka with Zookeeper.

Ephemeral cluster:: In general, an ephemeral (that is, temporary) Kafka cluster is suitable for development and testing purposes, not for production. This deployment uses `emptyDir` volumes for storing broker information (for Zookeeper) and topics or partitions (for Kafka). Using an `emptyDir` volume means that its content is strictly related to the pod life cycle and is deleted when the pod goes down.

Persistent cluster:: A persistent Kafka cluster uses `PersistentVolumes` to store Zookeeper and Kafka data. The `PersistentVolume` is
acquired using a `PersistentVolumeClaim` to make it independent of the actual type of the `PersistentVolume`. For example, it can use
ifdef::Kubernetes[HostPath volumes on Minikube or]
Amazon EBS volumes in Amazon AWS deployments without any changes in the YAML files. The `PersistentVolumeClaim` can use a `StorageClass` to trigger automatic volume provisioning.

{ProductName} includes two templates for deploying a Kafka cluster:

* `kafka-ephemeral.yaml` deploys an ephemeral cluster, named `my-cluster` by default.
* `kafka-persistent.yaml` deploys a persistent cluster, named `my-cluster` by default.

The cluster name is defined by the name of the resource and cannot be changed after the cluster has been deployed. To change the cluster name before you deploy the cluster, edit the `Kafka.metadata.name` property of the resource in the relevant YAML file.

[source,yaml,subs=+quotes]
----
apiVersion: kafka.strimzi.io/v1alpha1
kind: Kafka
metadata:
  name: my-cluster
# ...
----

ifdef::Kubernetes[]
include::proc-deploying-kafka-cluster-kubernetes.adoc[leveloffset=+1]
endif::Kubernetes[]

include::proc-deploying-kafka-cluster-openshift.adoc[leveloffset=+1]
