Also see:
Sed for OSX
sed
for OSX works differently than on Linux, the easiest way around it to use the gnu-sed tool:
brew install gnu-sed
You then need to replace sed
later on with gsed
.
First we need to clone the Strimzi repository:
git clone https://github.com/strimzi/strimzi-kafka-operator.git -b release-0.10.x
sed -i 's/namespace: .*/namespace: kafka/' strimzi/install/cluster-operator/*RoleBinding*.yaml
oc login -u admin
oc new-project kafka --display-name='Kafka Cluster'
oc apply -f strimzi/install/cluster-operator
oc apply -f kafka
oc login -u developer
Next we need a bridge which forwards AMQP 1.0, coming from Eclipse Hono, to Apache Kafka.
oc new-project hono-consumer --display-name 'Hono Consumer'
oc new-app fabric8/s2i-java~https://github.com/ctron/hono-example-bridge#tutorial-ece2018 -e KAFKA_CLUSTER_NAME=hono-kafka-cluster -e KAFKA_PROJECT=kafka -e AMQP_HOST=messaging-hono-default.enmasse-infra.svc AMQP_USERNAME=consumer AMQP_PASSWORD=verysecret
oc set probe dc/hono-example-bridge --readiness --liveness --get-url=http://:8080/health
oc patch dc/hono-example-bridge --patch '{"spec":{"template":{"spec":{"containers":[{"name":"hono-example-bridge", "ports":[{"containerPort":8778, "name":"jolokia" }]}]}}}}'
The next step deploys a web frontend, which consumes data from Kafka and displays it in some kind of Web UI gauge.
oc new-project demo-gauge --display-name "Demo Gauge"
oc new-app centos/nodejs-8-centos7~https://github.com/ctron/hono-example-demo-gauge#tutorial-ece2018 -e KAFKA_CLUSTER_NAME=hono-kafka-cluster -e KAFKA_PROJECT=kafka -e PAYLOAD_FORMAT=kura
oc create route edge --service=hono-example-demo-gauge