Skip to content

Commit

Permalink
[#486] Update Ditto chart version in cloud2edge chart.
Browse files Browse the repository at this point in the history
Using the Ditto chart from the Ditto repository now.
Also updated the tour to add instructions on using
the Ditto UI.

Signed-off-by: Carsten Lohmann <carsten.lohmann@bosch.io>
  • Loading branch information
calohmn committed Sep 7, 2023
1 parent 47880db commit 7b15cda
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
14 changes: 13 additions & 1 deletion homepage/_packages/cloud2edge/scripts/setCloud2EdgeEnv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ function getPorts {
PORT=$(kubectl get service $SERVICENAME -n $NS -o jsonpath='{.spec.ports[?(@.name=='"'$NAME'"')].'$TYPE'}' 2> /dev/null)
if [ $? -eq 0 ] && [ "$PORT" != '' ]; then
NAME=${NAME/secure-mqtt/mqtts}
NAME=${NAME/query-http/http}
UPPERCASE_PORT_NAME=$(echo $NAME | tr [a-z\-] [A-Z_])
echo "export ${ENV_VAR_PREFIX}_PORT_${UPPERCASE_PORT_NAME}=\"$PORT\""
echo "export ${ENV_VAR_PREFIX}_BASE_URL=\"$NAME://$IP:$PORT\""
if [ "$PORT" = '80' ]; then
echo "export ${ENV_VAR_PREFIX}_BASE_URL=\"$NAME://$IP\""
declare -g ${ENV_VAR_PREFIX}_BASE_URL="$NAME://$IP"
else
echo "export ${ENV_VAR_PREFIX}_BASE_URL=\"$NAME://$IP:$PORT\""
declare -g ${ENV_VAR_PREFIX}_BASE_URL="$NAME://$IP:$PORT"
fi
fi
done

Expand Down Expand Up @@ -74,6 +81,11 @@ getService adapter-coap "coap coaps" COAP_ADAPTER
getService adapter-http "http https" HTTP_ADAPTER
getService adapter-mqtt "mqtt secure-mqtt" MQTT_ADAPTER
getService ditto-nginx "http" DITTO_API
getService jaeger-query "query-http" JAEGER_QUERY

DITTO_DEVOPS_PWD=$(kubectl --namespace ${NS} get secret ${RELEASE}-ditto-gateway-secret -o jsonpath="{.data.devops-password}" | base64 --decode)
echo "export DITTO_DEVOPS_PWD=\"$DITTO_DEVOPS_PWD\""
echo "export DITTO_UI_ENV_JSON=\"{\\\"api_uri\\\":\\\"${DITTO_API_BASE_URL}\\\",\\\"defaultUsernamePassword\\\":\\\"ditto:ditto\\\",\\\"defaultDittoPreAuthenticatedUsername\\\":null,\\\"defaultUsernamePasswordDevOps\\\":\\\"devops:${DITTO_DEVOPS_PWD}\\\",\\\"mainAuth\\\":\\\"basic\\\",\\\"devopsAuth\\\":\\\"basic\\\"}\""

echo
echo "# Run this command to populate environment variables"
Expand Down
20 changes: 19 additions & 1 deletion homepage/_packages/cloud2edge/tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Download the [setCloud2EdgeEnv script](../scripts/setCloud2EdgeEnv.sh) and use i
to set environment variables for the Cloud2Edge package's service endpoints.

{% clipboard %}
curl https://www.eclipse.org/packages/packages/cloud2edge/scripts/setCloud2EdgeEnv.sh --output setCloud2EdgeEnv.sh
curl https://www.eclipse.org/packages/packages/cloud2edge/scripts/setCloud2EdgeEnv.sh \
--output setCloud2EdgeEnv.sh
chmod u+x setCloud2EdgeEnv.sh

RELEASE=c2e
Expand All @@ -56,6 +57,23 @@ HTTP_ADAPTER_PORT=443

{% endvariants %}

## Accessing the Ditto Explorer User Interface

The browser based [Ditto Explorer UI](https://eclipse.dev/ditto/user-interface.html) shows Ditto things, policies and connections.
On Kubernetes, the above-mentioned `setCloud2EdgeEnv` script provides environment variables to access and configure it.
The command
{% clipboard %}
echo $DITTO_API_BASE_URL
{% endclipboard %}
prints out the URL where to access the Ditto UI and Ditto API documentation.

In the Ditto UI, click on the `Environments` link at the top and then the `Environment JSON` tab. Clicking on "Edit" lets you enter an arbitrary Name (e.g. `default`)
and below a JSON value, to be taken from the output of the following command.
{% clipboard %}
echo $DITTO_UI_ENV_JSON
{% endclipboard %}
Clicking on `Create` and switching to the created environment in the top bar `Environment` dropdown completes the configuration.

## Publishing telemetry data

The Cloud2Edge package comes with a pre-provisioned example device that we will use to publish
Expand Down
2 changes: 1 addition & 1 deletion homepage/prereqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ minikube start ... --addons ingress
You will need an installation of Helm on the machine which is used to deploy the packages. You can find
installation instructions for Helm in the Helm documentation under [Installing Helm](https://helm.sh/docs/using_helm/#installing-helm).

The required Helm version is 3.4 or later.
The required Helm version is 3.8 or later.

### Repository

Expand Down
4 changes: 2 additions & 2 deletions packages/cloud2edge/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ dependencies:
version: ~2.4.0
repository: "https://eclipse.org/packages/charts/"
- name: ditto
version: ~3.1.0
repository: "https://eclipse.org/packages/charts/"
version: ~3.3.6
repository: "oci://registry-1.docker.io/eclipse"
6 changes: 6 additions & 0 deletions packages/cloud2edge/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ hono:

# Configuration properties for Eclipse Ditto.
ditto:
global:
basicAuthUsers:
ditto:
user: ditto
password: ditto

# do not set cpu limits for Ditto to avoid CFS scheduler limits
# ref: https://doc.akka.io/docs/akka/snapshot/additional/deploy.html#in-kubernetes
connectivity:
Expand Down

0 comments on commit 7b15cda

Please sign in to comment.