Skip to content

Commit

Permalink
Merge pull request #229 from bosch-io/ditto-20
Browse files Browse the repository at this point in the history
Prepare for Ditto 2.0
  • Loading branch information
thjaeckle authored May 6, 2021
2 parents 009ddf0 + 0d1bf3a commit 02b06c0
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 77 deletions.
11 changes: 6 additions & 5 deletions charts/ditto/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ name: ditto
description: |
Eclipse Ditto™ is a technology in the IoT implementing a software pattern called “digital twins”.
A digital twin is a virtual, cloud based, representation of his real world counterpart
(real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids,
EV charging stations etc).
version: 1.5.3
appVersion: 1.5.1
(real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations etc).
version: 2.0.0
appVersion: 2.0.0
keywords:
- iot-chart
- IoT
Expand All @@ -30,4 +29,6 @@ maintainers:
- name: axdotl
email: [email protected]
- name: thjaeckle
email: [email protected]
email: [email protected]
- name: stmaute
email: [email protected]
12 changes: 7 additions & 5 deletions charts/ditto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## Introduction

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

This chart uses `eclipse/ditto-XXX` containers to run Ditto inside Kubernetes.

Expand Down Expand Up @@ -49,7 +50,7 @@ Alternatively, a YAML file that specifies the values for the parameters can be p

### OpenID Connect (OIDC)

To enable OIDC authentiaction adjust following properties:
To enable OIDC authentication adjust following properties:

```yaml
global:
Expand Down Expand Up @@ -135,9 +136,10 @@ kind delete cluster

### Troubleshooting

If you experience high resource consumption (either CPU or RAM or both), you can limit the resource usage by specifing resource limits.
If you experience high resource consumption (either CPU or RAM or both), you can limit the resource usage by
specifying resource limits.
This can be done individually for each single component.
Here is an example how to limit CPU to 0.25 Cores and RAM to 512MiB for the `connectivity` service:
Here is an example how to limit CPU to 0.25 Cores and RAM to 512 MiB for the `connectivity` service:

```bash
helm upgrade eclipse-ditto . --install --set connectivity.resources.limits.cpu=0.25 --set connectivity.resources.limits.memory=512Mi
Expand Down
3 changes: 1 addition & 2 deletions charts/ditto/nginx-config/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ <h1>You have started Eclipse Ditto</h1>
<a href="https://www.eclipse.org/ditto/intro-hello-world.html">Ditto documentation intro</a> and/or the
<a href="https://www.eclipse.org/ditto/http-api-doc.html">Ditto HTTP API documentation</a>.
</p>
<p>In order to get started quickly and if you started the local swaggerui, you can now have a look at the OpenAPI documentation for
<p>In order to get started quickly and if you started the local swagger-ui, you can now have a look at the OpenAPI documentation for
<ul>
<li><a href="/apidoc/1">API version 1</a></li>
<li><a href="/apidoc/2">API version 2</a></li>
</ul>
<p>Try out the HTTP APIs by using username "ditto" and password "ditto" when asked for by your browser.</p>
Expand Down
2 changes: 1 addition & 1 deletion charts/ditto/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse Ditto installed!
Eclipse Ditto successfully installed!

{{- if ( not .Values.routes.enabled ) }}
Access Ditto in your browser (http://localhost:8080) by running:
Expand Down
5 changes: 1 addition & 4 deletions charts/ditto/templates/concierge-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
- name: TZ
value: "{{ .Values.global.timezone }}"
- name: OPENJ9_JAVA_OPTIONS
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on{{ if .Values.dbconfig.concierge.ssl }} -Dorg.mongodb.async.type=netty{{ end }}"
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on"
- name: MONGO_DB_SSL_ENABLED
value: "{{ if .Values.dbconfig.concierge.ssl }}true{{ else }}false{{ end }}"
- name: MONGO_DB_URI
Expand All @@ -101,9 +101,6 @@ spec:
{{- toYaml .Values.concierge.extraEnv | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
- name: remoting
containerPort: {{ .Values.akka.remoting.port }}
protocol: TCP
Expand Down
5 changes: 1 addition & 4 deletions charts/ditto/templates/connectivity-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
- name: TZ
value: "{{ .Values.global.timezone }}"
- name: OPENJ9_JAVA_OPTIONS
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on{{ if .Values.dbconfig.connectivity.ssl }} -Dorg.mongodb.async.type=netty{{ end }}"
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on"
- name: MONGO_DB_SSL_ENABLED
value: "{{ if .Values.dbconfig.connectivity.ssl }}true{{ else }}false{{ end }}"
- name: MONGO_DB_URI
Expand All @@ -101,9 +101,6 @@ spec:
{{- toYaml .Values.connectivity.extraEnv | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
- name: remoting
containerPort: {{ .Values.akka.remoting.port }}
protocol: TCP
Expand Down
2 changes: 1 addition & 1 deletion charts/ditto/templates/gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ spec:
{{- end }}
ports:
- name: http
containerPort: 8080
containerPort: {{ .Values.gateway.service.port }}
protocol: TCP
- name: remoting
containerPort: {{ .Values.akka.remoting.port }}
Expand Down
64 changes: 32 additions & 32 deletions charts/ditto/templates/nginx-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ data:
{{ if .Values.global.jwtOnly -}}
proxy_pass_request_headers on;
proxy_set_header Authorization $http_authorization;
proxy_set_header Authorization $http_authorization;
{{ else }}
auth_basic "Authentication required";
auth_basic_user_file nginx.htpasswd;
proxy_set_header X-Forwared-User $remote_user;
proxy_set_header x-ditto-dummy-auth "nginx:${remote_user}";
proxy_set_header X-Forwared-User $remote_user;
proxy_set_header x-ditto-pre-authenticated "nginx:${remote_user}";
{{- end }}
proxy_pass http://{{ include "ditto.fullname" . }}-gateway;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Connection '';
chunked_transfer_encoding off;
Expand All @@ -83,22 +83,22 @@ data:
{{ if .Values.global.jwtOnly -}}
proxy_pass_request_headers on;
proxy_set_header Authorization $http_authorization;
proxy_set_header Authorization $http_authorization;
{{ else }}
auth_basic "Authentication required";
auth_basic_user_file nginx.htpasswd;
proxy_set_header X-Forwared-User $remote_user;
proxy_set_header x-ditto-dummy-auth "nginx:${remote_user}";
proxy_set_header X-Forwared-User $remote_user;
proxy_set_header x-ditto-pre-authenticated "nginx:${remote_user}";
{{- end }}
proxy_pass http://{{ include "ditto.fullname" . }}-gateway;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 1d;
proxy_send_timeout 1d;
}
Expand All @@ -109,10 +109,10 @@ data:
proxy_pass http://{{ include "ditto.fullname" . }}-gateway/health;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-User $remote_user;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-User $remote_user;
}
# status
Expand All @@ -121,10 +121,10 @@ data:
proxy_pass http://{{ include "ditto.fullname" . }}-gateway/overall/status;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-User $remote_user;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-User $remote_user;
}
# stats
Expand All @@ -133,10 +133,10 @@ data:
proxy_pass http://{{ include "ditto.fullname" . }}-gateway/stats;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-User $remote_user;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-User $remote_user;
}
# devops
Expand All @@ -145,20 +145,20 @@ data:
proxy_pass http://{{ include "ditto.fullname" . }}-gateway/devops;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-User $remote_user;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-User $remote_user;
}
{{ if .Values.swaggerui.enabled -}}
# swagger
# access API doc on: /apidoc/1 or /apidoc/2
# access API doc on: /apidoc/2
location /apidoc/ {
rewrite ^/apidoc/([0-9])$ $scheme://$http_host/apidoc/?url=//raw.githubusercontent.com/eclipse/ditto/{{ .Chart.AppVersion }}/documentation/src/main/resources/openapi/ditto-api-$1.yml redirect;
proxy_pass http://{{ include "ditto.fullname" . }}-swaggerui:8080/;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Host $http_host;
}
{{- end }}
}
Expand Down
41 changes: 39 additions & 2 deletions charts/ditto/templates/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,46 @@
---
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "ditto.fullname" . -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "ditto.name" . }}-nginx
{{ include "ditto.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
service:
name: {{ $fullName }}-nginx
port:
name: http
{{- end }}
{{- end }}
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
{{- else }}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
Expand Down
2 changes: 1 addition & 1 deletion charts/ditto/templates/policies-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
- name: TZ
value: "{{ .Values.global.timezone }}"
- name: OPENJ9_JAVA_OPTIONS
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on{{ if .Values.dbconfig.policies.ssl }} -Dorg.mongodb.async.type=netty{{ end }}"
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on"
- name: MONGO_DB_SSL_ENABLED
value: "{{ if .Values.dbconfig.policies.ssl }}true{{ else }}false{{ end }}"
- name: MONGO_DB_URI
Expand Down
5 changes: 1 addition & 4 deletions charts/ditto/templates/things-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
- name: TZ
value: "{{ .Values.global.timezone }}"
- name: OPENJ9_JAVA_OPTIONS
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on{{ if .Values.dbconfig.things.ssl }} -Dorg.mongodb.async.type=netty{{ end }}"
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on"
- name: MONGO_DB_SSL_ENABLED
value: "{{ if .Values.dbconfig.things.ssl }}true{{ else }}false{{ end }}"
- name: MONGO_DB_URI
Expand All @@ -101,9 +101,6 @@ spec:
{{- toYaml .Values.things.extraEnv | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
- name: remoting
containerPort: {{ .Values.akka.remoting.port }}
protocol: TCP
Expand Down
5 changes: 1 addition & 4 deletions charts/ditto/templates/thingssearch-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
- name: TZ
value: "{{ .Values.global.timezone }}"
- name: OPENJ9_JAVA_OPTIONS
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on{{ if .Values.dbconfig.searchDB.ssl }} -Dorg.mongodb.async.type=netty{{ end }}"
value: "-XX:+ExitOnOutOfMemoryError -Xtune:virtualized -Xss512k -XX:MaxRAMPercentage=80 -XX:InitialRAMPercentage=40 -Dakka.coordinated-shutdown.exit-jvm=on"
- name: MONGO_DB_SSL_ENABLED
value: "{{ if .Values.dbconfig.searchDB.ssl }}true{{ else }}false{{ end }}"
- name: MONGO_DB_URI
Expand All @@ -101,9 +101,6 @@ spec:
{{- toYaml .Values.thingsSearch.extraEnv | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
- name: remoting
containerPort: {{ .Values.akka.remoting.port }}
protocol: TCP
Expand Down
Loading

0 comments on commit 02b06c0

Please sign in to comment.