Skip to content

Commit bdb0c36

Browse files
committed
added README.md for new Ditto Helm chart specifying configuration options
Signed-off-by: Thomas Jäckle <[email protected]>
1 parent 3fe3e11 commit bdb0c36

File tree

2 files changed

+136
-28
lines changed

2 files changed

+136
-28
lines changed

deployment/helm/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Eclipse Ditto :: Helm
2+
3+
The official Ditto Helm chart is managed here, in folder [ditto](ditto/).
4+
It is deployed as "OCI artifact" to Docker Hub at: https://hub.docker.com/r/eclipse/ditto
5+
6+
## Install Ditto via Helm Chart
7+
8+
To install the chart with the release name eclipse-ditto, run the following commands:
9+
10+
```shell script
11+
helm install -n ditto my-ditto oci://registry-1.docker.io/eclipse/ditto --version <version> --wait
12+
```
13+
14+
# Uninstall the Helm Chart
15+
16+
To uninstall/delete the `my-ditto` deployment:
17+
18+
```shell script
19+
helm uninstall my-ditto
20+
```

deployment/helm/ditto/README.md

+116-28
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,137 @@
1-
# Eclipse Ditto :: Helm
1+
# Eclipse Ditto
22

3-
The Ditto Helm chart sources are managed here.
3+
## Introduction
44

5-
## Install Ditto via Helm Chart
5+
[Eclipse Ditto™](https://www.eclipse.org/ditto/) is a technology in the IoT implementing a software pattern
6+
called “digital twins”. A digital twin is a virtual, cloud based, representation of his real world counterpart
7+
(real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations, …).
68

7-
To install the chart with the release name eclipse-ditto, run the following commands:
9+
This chart uses `eclipse/ditto-XXX` containers to run Ditto inside Kubernetes.
810

9-
```shell script
10-
helm repo add eclipse-iot https://www.eclipse.org/packages/charts/
11-
helm repo update
12-
helm install eclipse-ditto eclipse-iot/ditto
11+
## Prerequisites
12+
13+
Installing Ditto using the chart requires the Helm tool to be installed as described on the
14+
[IoT Packages chart repository prerequisites](https://www.eclipse.org/packages/prereqs/) page.
15+
16+
TL;DR:
17+
18+
* have a correctly configured [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl) (either against a local or remote k8s cluster)
19+
* have [Helm installed](https://helm.sh/docs/intro/)
20+
21+
The Helm chart is being tested to successfully install on the three most recent Kubernetes versions.
22+
23+
## Installing the Chart
24+
25+
The instructions below illustrate how Ditto can be installed to the `ditto` namespace in a Kubernetes cluster using
26+
release name `eclipse-ditto`.
27+
The commands can easily be adapted to use a different name space or release name.
28+
29+
The target name space in Kubernetes only needs to be created if it doesn't exist yet:
30+
31+
```bash
32+
kubectl create namespace ditto
1333
```
1434

15-
# Uninstall the Helm Chart
35+
The chart can then be installed to name space `ditto` using release name `my-ditto`:
1636

17-
To uninstall/delete the eclipse-ditto deployment:
37+
```bash
38+
helm install --dependency-update -n ditto my-ditto oci://registry-1.docker.io/eclipse/ditto --version <version> --wait
39+
```
40+
41+
42+
## Uninstalling the Chart
43+
44+
To uninstall/delete the `my-ditto` release:
1845

19-
```shell script
20-
helm delete eclipse-ditto
46+
```bash
47+
helm uninstall -n ditto my-ditto
2148
```
2249

23-
# Working locally with the chart
50+
The command removes all the Kubernetes components associated with the chart and deletes the release.
2451

25-
In order to test / develop the chart locally, this section should be of help.
52+
## Configuration
2653

27-
## Testing templating
28-
For that, no running k8s cluster is necessary - the output will be the rendered k8s deployment descriptors:
54+
Please view the `values.yaml` for the list of possible configuration values with its documentation.
2955

30-
```shell
31-
helm template my-ditto . -f values.yaml -f local-values.yaml --debug
56+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
57+
58+
```bash
59+
helm install -n ditto my-ditto oci://registry-1.docker.io/eclipse/ditto --version <version> --set swaggerui.enabled=false
3260
```
3361

34-
## Installation
35-
To install the Ditto chart with the name `"my-ditto"`, perform:
62+
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart.
63+
64+
## Chart configuration options
65+
66+
Please consult the [values.yaml](https://github.com/eclipse-ditto/ditto/blob/master/deployment/helm/ditto/values.yaml)
67+
for all available configuration options of the Ditto Helm chart.
68+
69+
### Scaling options
3670

37-
```shell
38-
helm install -f values.yaml -f local-values.yaml my-ditto . --wait
39-
kubectl port-forward svc/my-ditto-nginx 8080:8080
71+
Please note the defaults the chart comes with:
72+
* the default deploy 1 instance per Ditto service
73+
* each Ditto service is configured to require:
74+
* 0.5 CPUs
75+
* 1024 MiB of memory
76+
77+
Adjust this to your requirements, e.g. scale horizontally by configuring a higher `replicaCount` or vertically by
78+
configuring more resources.
79+
80+
## Advanced configuration options
81+
82+
Even more configuration options, not exposed to the `values.yaml`, can be configured using either environment variables
83+
or Java "System properties".
84+
To inspect all available configuration options, please inspect Ditto's service configurations:
85+
86+
* [policies.conf](https://github.com/eclipse-ditto/ditto/blob/master/policies/service/src/main/resources/policies.conf)
87+
* [things.conf](https://github.com/eclipse-ditto/ditto/blob/master/things/service/src/main/resources/things.conf)
88+
* [things-search.conf](https://github.com/eclipse-ditto/ditto/blob/master/thingsearch/service/src/main/resources/search.conf)
89+
* [connectivity.conf](https://github.com/eclipse-ditto/ditto/blob/master/connectivity/service/src/main/resources/connectivity.conf)
90+
* [gateway.conf](https://github.com/eclipse-ditto/ditto/blob/master/gateway/service/src/main/resources/gateway.conf)
91+
92+
93+
### Configuration via environment variables
94+
95+
In order to provide an environment variable config overwrite, simply put the environment variable in the `extraEnv`
96+
of the Ditto service you want to specify the configuration for.
97+
98+
E.g. if you want to configure the `LOG_INCOMING_MESSAGES` for the `things` service to be disabled:
99+
```yaml
100+
things:
101+
# ...
102+
extraEnv:
103+
- name: LOG_INCOMING_MESSAGES
104+
value: "false"
40105
```
41106
42-
Now, you can access Ditto on [http://localhost:8080](http://localhost:8080) - have fun.
107+
### Configuration via system properties
108+
109+
Not all Ditto/Akka configuration options have an environment variable overwrite defined in the configuration.
110+
For configurations without such an environment variable overwrite, the option can be configured via Java system property.
111+
The documentation on how this works can be found in the
112+
[HOCON documentation](https://github.com/lightbend/config/blob/main/HOCON.md#conventional-override-by-system-properties),
113+
which is the configuration format Ditto uses.
114+
115+
E.g. if you want to would like to adjust the `journal-collection` name which the `things` service uses to write its
116+
journal entries to MongoDB (which can be found [here](https://github.com/eclipse-ditto/ditto/blob/33a38bc04b47d0167ba0e99fe76d96a54aa3d162/things/service/src/main/resources/things.conf#L268)),
117+
simply configure:
118+
119+
120+
```yaml
121+
things:
122+
# ...
123+
systemProps:
124+
- "-Dakka-contrib-mongodb-persistence-things-journal.overrides.journal-collection=another_fancy_name"
125+
```
126+
127+
128+
## Troubleshooting
43129

44-
## Uninstallation
45-
To uninstall the chart again, perform:
130+
If you experience high resource consumption (either CPU or RAM or both), you can limit the resource usage by
131+
specifying resource limits.
132+
This can be done individually for each single component.
133+
Here is an example how to limit CPU to 0.25 Cores and RAM to 512 MiB for the `connectivity` service:
46134

47-
```shell
48-
helm uninstall my-ditto
135+
```bash
136+
helm upgrade -n ditto eclipse-ditto . --install --set connectivity.resources.limits.cpu=0.25 --set connectivity.resources.limits.memory=512Mi
49137
```

0 commit comments

Comments
 (0)