The functionality of this quickstart depends on a running instance of the AMQ Streams Operator. AMQ Streams is a Red Hat project based on Apache Kafka. To deploy AMQ Streams in the Openshift environment:
-
Log in into the Openshift console as
kubeadmin
user (or any cluster administrator). -
Install the
Red Hat Streams for Apache Kafka
operator -
Create an instance of
Red Hat Streams for Apache Kafka
-
Create a topic in the
Red Hat Streams for Apache Kafka
Install it with the default values and wait for the message telling you it has been installed and is ready for use.
In your terminal, run the following command to subscribe the Red Hat Streams for Apache Kafka
operator.
$ oc apply -f ./charts/amq-operator-on-openshift.yaml --wait --timeout=10m0s
To verify the operator is ready to use, you can run the following command. You should see the following output.
The PHASE
needs to be Succeeded
$ oc get ClusterServiceVersion NAME DISPLAY VERSION REPLACES PHASE amqstreams.v2.7.0-1 Red Hat Streams for Apache Kafka 2.7.0-1 amqstreams.v2.7.0-0 Succeeded
Then you can set up a Kafka cluster called my-cluster
with topic testing
in your project:
$ oc apply -f ./charts/kafka-on-openshift.yaml --wait --timeout=10m0s
Although the above commands will return pretty immediately, your AMQ Streams instance will not be available until its entity operator is up and running. The name of the pod will be of the format my-cluster-entity-operator-xxxxxxxxx-yyyyy
.
To be on the safe side, wait until this pod is ready, as shown in this example:
oc get pods -w NAME READY STATUS RESTARTS AGE my-cluster-zookeeper-0 0/1 Running 0 29s ... my-cluster-entity-operator-cbdbffd4d-m7fzh 0/2 Pending 0 0s my-cluster-entity-operator-cbdbffd4d-m7fzh 0/2 ContainerCreating 0 0s my-cluster-entity-operator-cbdbffd4d-m7fzh 0/2 ContainerCreating 0 0s my-cluster-entity-operator-cbdbffd4d-m7fzh 0/2 Running 0 1s my-cluster-entity-operator-cbdbffd4d-m7fzh 1/2 Running 0 20s my-cluster-entity-operator-cbdbffd4d-m7fzh 2/2 Running 0 21s