Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#3582] Fix env setup in 'Getting Started' guide. #3583

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions site/documentation/content/getting-started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ tab below that matches your chosen type of messaging infrastructure and follow t
{{< tabs groupId="hono-instance" >}}
{{% tab name="Sandbox" %}}

Hono consists of a set of micro services which are deployed as Docker containers. The diagram below provides
Hono consists of a set of microservices which are deployed as Docker containers. The diagram below provides
an overview of the containers that are part of the Hono Sandbox deployment.

{{< figure src="Hono_instance_kafka.svg" title="Components of the Hono Sandbox deployment"
Expand All @@ -105,7 +105,7 @@ alt="The Docker containers representing the services of the example Hono Sandbox
* An *Apache Zookeeper* instance that is required by the Kafka cluster.
* Monitoring Infrastructure
* A *Prometheus* instance for storing metrics data from services and protocol adapters.
* A *Grafana* instance providing a dash board visualizing the collected metrics data.
* A *Grafana* instance providing a dashboard visualizing the collected metrics data.

In the example scenario used in the remainder of this guide, the devices will connect to the HTTP and MQTT adapters in
order to publish telemetry data and events. The devices will be authenticated using information stored in the Device
Expand Down Expand Up @@ -154,7 +154,7 @@ follow these steps:
1. Follow the instructions given in the [README](https://github.com/eclipse/packages/blob/master/charts/hono/README.md)
of Hono's Helm chart in order to install Hono with a single-node Kafka instance to your local Minikube cluster.

Hono consists of a set of micro services which are deployed as Docker containers. The diagram below provides an overview
Hono consists of a set of microservices which are deployed as Docker containers. The diagram below provides an overview
of the containers that are part of the example deployment of Hono on the local Minikube cluster.

{{< figure src="Hono_instance_kafka.svg" title="Components of the example Hono deployment using Kafka"
Expand All @@ -174,7 +174,7 @@ alt="The Docker containers representing the services of the example Hono deploym
* An *Apache Zookeeper* instance that is required by the Kafka cluster.
* Monitoring Infrastructure
* A *Prometheus* instance for storing metrics data from services and protocol adapters.
* A *Grafana* instance providing a dash board visualizing the collected metrics data.
* A *Grafana* instance providing a dashboard visualizing the collected metrics data.

In the example scenario used in the remainder of this guide, the devices will connect to the HTTP and MQTT adapters in
order to publish telemetry data and events. The devices will be authenticated using information stored in the Device
Expand All @@ -189,10 +189,10 @@ echo "export HTTP_ADAPTER_IP=$(kubectl get service eclipse-hono-adapter-http --o
echo "export MQTT_ADAPTER_IP=$(kubectl get service eclipse-hono-adapter-mqtt --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)" >> hono.env
KAFKA_IP=$(kubectl get service eclipse-hono-kafka-0-external --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)
TRUSTSTORE_PATH=/tmp/truststore.pem
kubectl get secrets eclipse-hono-kafka-example-keys --template="{{index .data \"ca.crt\" | base64decode}}" -n hono > ${TRUSTSTORE_PATH}
kubectl get configmaps eclipse-hono-example-trust-store --template="{{index .data \"ca.crt\"}}" -n hono > ${TRUSTSTORE_PATH}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: The change in addressing the ca.crt for the $TRUSTSTORE_PATH via
kubectl get configmaps eclipse-hono-example-trust-store
instead of
kubectl get secrets eclipse-hono-kafka-example-keys
means that the Hono chart
example/certs/trusted-certs.pem
instead of
example/certs/ca-cert.pem
is used.

Without this change, mosquitto_pub/sub will return an error:
OpenSSL Error[0]: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

It seems that the example/certs/root-cert.pem included in example/certs/trusted-certs.pem is needed.

echo "export APP_OPTIONS='-H ${KAFKA_IP} -P 9094 -u hono -p hono-secret --ca-file ${TRUSTSTORE_PATH} --disable-hostname-verification'" >> hono.env
echo "export CURL_OPTIONS='--cacert ${TRUSTSTORE_PATH}'" >> hono.env
echo "export MOSQUITTO_OPTIONS='--cafile ${TRUSTSTORE_PATH}'" >> hono.env
echo "export CURL_OPTIONS='--insecure'" >> hono.env
echo "export MOSQUITTO_OPTIONS='--cafile ${TRUSTSTORE_PATH} --insecure'" >> hono.env
~~~

Verify that the `hono.env` file has been created in your current working directory:
Expand All @@ -205,8 +205,8 @@ export REGISTRY_IP=(host name/IP address)
export HTTP_ADAPTER_IP=(host name/IP address)
export MQTT_ADAPTER_IP=(host name/IP address)
export APP_OPTIONS='-H (host name/IP address) -P 9094 -u hono -p hono-secret --ca-file /tmp/truststore.pem --disable-hostname-verification'
export CURL_OPTIONS='--cacert /tmp/truststore.pem'
export MOSQUITTO_OPTIONS='--cafile /tmp/truststore.pem'
export CURL_OPTIONS='--insecure'
export MOSQUITTO_OPTIONS='--cafile /tmp/truststore.pem --insecure'
~~~

{{% /tab %}}
Expand All @@ -223,7 +223,7 @@ follow these steps:
of Hono's Helm chart in order to install Hono with a single-node Qpid Dispatch Router instance to your local Minikube
cluster.

Hono consists of a set of micro services which are deployed as Docker containers. The diagram below provides an overview
Hono consists of a set of microservices which are deployed as Docker containers. The diagram below provides an overview
of the containers that are part of the example deployment of Hono on the local Minikube cluster.

{{< figure src="Hono_instance_amqp.svg" title="Components of the example Hono deployment using AMQP 1.0"
Expand All @@ -243,7 +243,7 @@ alt="The Docker containers representing the services of the example Hono deploym
* An *Apache ActiveMQ Artemis* instance serving as the persistence store for events.
* Monitoring Infrastructure
* A *Prometheus* instance for storing metrics data from services and protocol adapters.
* A *Grafana* instance providing a dash board visualizing the collected metrics data.
* A *Grafana* instance providing a dashboard visualizing the collected metrics data.

In the example scenario used in the remainder of this guide, the devices will connect to the HTTP and MQTT adapters in
order to publish telemetry data and events. The devices will be authenticated using information stored in the Device
Expand All @@ -256,13 +256,12 @@ be used during the remainder of this guide to set and refresh some environment v
echo "export REGISTRY_IP=$(kubectl get service eclipse-hono-service-device-registry-ext --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)" > hono.env
echo "export HTTP_ADAPTER_IP=$(kubectl get service eclipse-hono-adapter-http --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)" >> hono.env
echo "export MQTT_ADAPTER_IP=$(kubectl get service eclipse-hono-adapter-mqtt --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)" >> hono.env
KAFKA_IP=$(kubectl get service eclipse-hono-kafka-0-external --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)
TRUSTSTORE_PATH=/tmp/truststore.pem
kubectl get secrets eclipse-hono-dispatch-router-example-keys --template="{{index .data \"ca.crt\" | base64decode}}" -n hono > ${TRUSTSTORE_PATH}
kubectl get configmaps eclipse-hono-example-trust-store --template="{{index .data \"ca.crt\"}}" -n hono > ${TRUSTSTORE_PATH}
AMQP_NETWORK_IP=$(kubectl get service eclipse-hono-dispatch-router-ext --output="jsonpath={.status.loadBalancer.ingress[0]['hostname','ip']}" -n hono)
echo "export APP_OPTIONS='--amqp -H ${AMQP_NETWORK_IP} -P 15671 -u consumer@HONO -p verysecret --ca-file ${TRUSTSTORE_PATH}' --disable-hostname-verification" >> hono.env
echo "export CURL_OPTIONS='--cacert ${TRUSTSTORE_PATH}'" >> hono.env
echo "export MOSQUITTO_OPTIONS='--cafile ${TRUSTSTORE_PATH}'" >> hono.env
echo "export APP_OPTIONS='--amqp -H ${AMQP_NETWORK_IP} -P 15671 -u consumer@HONO -p verysecret --ca-file ${TRUSTSTORE_PATH} --disable-hostname-verification'" >> hono.env
echo "export CURL_OPTIONS='--insecure'" >> hono.env
echo "export MOSQUITTO_OPTIONS='--cafile ${TRUSTSTORE_PATH} --insecure'" >> hono.env
~~~

Verify that the `hono.env` file has been created in your current working directory:
Expand All @@ -275,8 +274,8 @@ export REGISTRY_IP=(host name/IP address)
export HTTP_ADAPTER_IP=(host name/IP address)
export MQTT_ADAPTER_IP=(host name/IP address)
export APP_OPTIONS='--amqp -H (host name/IP address) -P 15671 -u consumer@HONO -p verysecret --ca-file /tmp/truststore.pem --disable-hostname-verification'
export CURL_OPTIONS='--cacert /tmp/truststore.pem'
export MOSQUITTO_OPTIONS='--cafile /tmp/truststore.pem'
export CURL_OPTIONS='--insecure'
export MOSQUITTO_OPTIONS='--cafile /tmp/truststore.pem --insecure'
~~~

{{% /tab %}}
Expand Down