From b798a1a1a5d8a131cfd64ef8f64517ac64d3c909 Mon Sep 17 00:00:00 2001 From: Kai Hudalla Date: Tue, 1 Jun 2021 13:26:37 +0200 Subject: [PATCH] Request more memory for embedded device registry type The JDBC based registry, when used with an embedded H2 DB, will require more memory to accommodate the additional H2 DB functionality. The resource requests and limits of the device registry can now also be set at the particular registry type level, falling back to the default values specified at the registry example level. Signed-off-by: Kai Hudalla --- charts/hono/Chart.yaml | 2 +- ...o-service-device-registry-statefulset.yaml | 2 +- ...o-service-device-registry-statefulset.yaml | 2 +- ...no-service-device-registry-deployment.yaml | 2 +- ...no-service-device-registry-deployment.yaml | 2 +- charts/hono/values.yaml | 24 +++++++++++++++++++ 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/charts/hono/Chart.yaml b/charts/hono/Chart.yaml index f23c8eec..c7306cab 100755 --- a/charts/hono/Chart.yaml +++ b/charts/hono/Chart.yaml @@ -15,7 +15,7 @@ name: hono description: | Eclipse Hono™ provides remote service interfaces for connecting large numbers of IoT devices to a back end and interacting with them in a uniform way regardless of the device communication protocol. -version: 1.8.2 +version: 1.8.3 # Version of Hono being deployed by the chart appVersion: 1.8.0 keywords: diff --git a/charts/hono/templates/hono-service-device-registry-embedded/hono-service-device-registry-statefulset.yaml b/charts/hono/templates/hono-service-device-registry-embedded/hono-service-device-registry-statefulset.yaml index 1667e4e6..b4f0eede 100644 --- a/charts/hono/templates/hono-service-device-registry-embedded/hono-service-device-registry-statefulset.yaml +++ b/charts/hono/templates/hono-service-device-registry-embedded/hono-service-device-registry-statefulset.yaml @@ -62,7 +62,7 @@ spec: {{- include "hono.container.secretVolumeMounts" ( dict "name" $args.name "componentConfig" .Values.deviceRegistryExample ) | indent 8 }} - name: "registry" mountPath: "/var/lib/hono/device-registry" - {{- with .Values.deviceRegistryExample.resources }} + {{- with ( default .Values.deviceRegistryExample.resources $args.componentConfig.resources ) }} resources: {{- . | toYaml | nindent 10 }} {{- end }} diff --git a/charts/hono/templates/hono-service-device-registry-file/hono-service-device-registry-statefulset.yaml b/charts/hono/templates/hono-service-device-registry-file/hono-service-device-registry-statefulset.yaml index 76c846dc..feeb70b2 100644 --- a/charts/hono/templates/hono-service-device-registry-file/hono-service-device-registry-statefulset.yaml +++ b/charts/hono/templates/hono-service-device-registry-file/hono-service-device-registry-statefulset.yaml @@ -62,7 +62,7 @@ spec: {{- include "hono.container.secretVolumeMounts" ( dict "name" $args.name "componentConfig" .Values.deviceRegistryExample ) | indent 8 }} - name: "registry" mountPath: "/var/lib/hono/device-registry" - {{- with .Values.deviceRegistryExample.resources }} + {{- with ( default .Values.deviceRegistryExample.resources $args.componentConfig.resources ) }} resources: {{- . | toYaml | nindent 10 }} {{- end }} diff --git a/charts/hono/templates/hono-service-device-registry-jdbc/hono-service-device-registry-deployment.yaml b/charts/hono/templates/hono-service-device-registry-jdbc/hono-service-device-registry-deployment.yaml index 59b267c8..cce450e7 100644 --- a/charts/hono/templates/hono-service-device-registry-jdbc/hono-service-device-registry-deployment.yaml +++ b/charts/hono/templates/hono-service-device-registry-jdbc/hono-service-device-registry-deployment.yaml @@ -57,7 +57,7 @@ spec: privileged: false volumeMounts: {{- include "hono.container.secretVolumeMounts" ( dict "name" $args.name "componentConfig" .Values.deviceRegistryExample ) | indent 8 }} - {{- with .Values.deviceRegistryExample.resources }} + {{- with ( default .Values.deviceRegistryExample.resources $args.componentConfig.resources ) }} resources: {{- . | toYaml | nindent 10 }} {{- end }} diff --git a/charts/hono/templates/hono-service-device-registry-mongodb/hono-service-device-registry-deployment.yaml b/charts/hono/templates/hono-service-device-registry-mongodb/hono-service-device-registry-deployment.yaml index 6545047b..cb13bf7c 100644 --- a/charts/hono/templates/hono-service-device-registry-mongodb/hono-service-device-registry-deployment.yaml +++ b/charts/hono/templates/hono-service-device-registry-mongodb/hono-service-device-registry-deployment.yaml @@ -57,7 +57,7 @@ spec: privileged: false volumeMounts: {{- include "hono.container.secretVolumeMounts" ( dict "name" $args.name "componentConfig" .Values.deviceRegistryExample ) | indent 8 }} - {{- with .Values.deviceRegistryExample.resources }} + {{- with ( default .Values.deviceRegistryExample.resources $args.componentConfig.resources ) }} resources: {{- . | toYaml | nindent 10 }} {{- end }} diff --git a/charts/hono/values.yaml b/charts/hono/values.yaml index 6a4db4f9..6786ef79 100755 --- a/charts/hono/values.yaml +++ b/charts/hono/values.yaml @@ -1228,6 +1228,10 @@ deviceRegistryExample: # configuration property of the component's readiness probe. # The value of the top level "readinessProbeInitialDelaySeconds" property will be used if not set. readinessProbeInitialDelaySeconds: + # If not specified here, then the values from "deviceRegistryExample.resources" are used. + # Refer to https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + # for a description of the properties' semantics. + resources: # embeddedJdbcDeviceRegistry contains configuration properties specific to the # embedded JDBC device registry. @@ -1257,6 +1261,18 @@ deviceRegistryExample: # configuration property of the component's readiness probe. # The value of the top level "readinessProbeInitialDelaySeconds" property will be used if not set. readinessProbeInitialDelaySeconds: + # resources contains the container's requests and limits for CPU and memory + # as defined by the Kubernetes API. + # If not specified here, then the values from "deviceRegistryExample.resources" are used. + # Refer to https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + # for a description of the properties' semantics. + resources: + requests: + cpu: "200m" + memory: "400Mi" + limits: + cpu: "1" + memory: "500Mi" # mongoDBBasedDeviceRegistry contains configuration properties specific to the # MongoDB based device registry. @@ -1282,6 +1298,10 @@ deviceRegistryExample: # configuration property of the component's readiness probe. # The value of the top level "readinessProbeInitialDelaySeconds" property will be used if not set. readinessProbeInitialDelaySeconds: + # If not specified here, then the values from "deviceRegistryExample.resources" are used. + # Refer to https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + # for a description of the properties' semantics. + resources: # mongodb contains the configuration properties to connect to the MongoDB database instance. # If you would like to use an already existing MongoDB database instance, then configure # the below section accordingly. @@ -1321,6 +1341,10 @@ deviceRegistryExample: # configuration property of the component's readiness probe. # The value of the top level "readinessProbeInitialDelaySeconds" property will be used if not set. readinessProbeInitialDelaySeconds: + # If not specified here, then the values from "deviceRegistryExample.resources" are used. + # Refer to https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + # for a description of the properties' semantics. + resources: # registry.jdbc contains the configuration properties for device registry # to connect to the database. registry: