:_mod-docs-content-type: PROCEDURE

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

[id='proc-connecting-console-{context}']
= Deploying and connecting the console to a Kafka cluster

[role="_abstract"]
Use the console operator to deploy the StreamsHub Console to the same Kubernetes cluster as a Kafka cluster managed by Strimzi. 
Use the console to connect to the Kafka cluster.

.Prerequisites

* xref:con-deploying-prereqs-{context}[Deployment prerequisites].
* The console operator is deployed to the Kubernetes cluster.

.Procedure

. Create a `Console` custom resource in the desired namespace. 
+
If you deployed the xref:proc-deploying-kafka-{context}[example Kafka cluster] provided with the installation artifacts, you can use the configuration specified in the `examples/console/010-Console-example.yaml` configuration file unchanged.
+
Otherwise, configure the resource to connect to your Kafka cluster.
+
.Deploying the console with an example configuration for connecting to a Kafka cluster
[source,yaml]
----
apiVersion: console.streamshub.github.com/v1alpha1
kind: Console
metadata:
  name: my-console
spec:
  hostname: my-console.<cluster_domain>
  kafkaClusters:
    - name: console-kafka
      namespace: kafka
      listener: secure
      properties:
        values: []
        valuesFrom: []
      credentials:
        kafkaUser:
          name: console-kafka-user1
----

* `hostname` defines the hostname used to access the console over HTTP.
* `kafkaClusters.name` specifies the name of the Strimzi `Kafka` resource that represents the cluster.
* `kafkaClusters.namespace` specifies the namespace where the `Kafka` resource is deployed.
* `kafkaClusters.listener` specifies the listener used to expose the Kafka cluster for console connections.
* `kafkaClusters.properties.values` optionally defines additional connection properties.
* `kafkaClusters.properties.valuesFrom` optionally specifies ConfigMaps or Secrets that provide connection properties.
* `kafkaClusters.credentials.kafkaUser.name` optionally specifies the Kafka user used for authenticated access to the Kafka cluster.

. Apply the `Console` configuration to install the console.
+
In this example, the console is deployed to the `console-namespace` namespace:
+
[source,shell]
----
kubectl apply -f examples/console/010-Console-example.yaml -n console-namespace

----

. Check the status of the deployment:
+
[source,shell]
----
oc get pods -n console-namespace
----
+
.Output shows the deployment name and readiness
[source,shell]
----
NAME           READY  STATUS  RUNNING
console-kafka  1/1    1       1
----

. Access the console.
+
When the console is running, use the hostname specified in the `Console` resource (`spec.hostname`) to access the user interface.