From 9020e5270a63fbe3d9ff21db31da975318a0990f Mon Sep 17 00:00:00 2001 From: Mathias Maes Date: Thu, 7 Sep 2023 15:05:54 +0200 Subject: [PATCH] [#494] add priorityClass support Signed-off-by: Mathias Maes --- charts/hono/Chart.yaml | 2 +- charts/hono/README.md | 5 ++++ charts/hono/templates/_helpers.tpl | 13 +++++++++++ .../templates/artemis/artemis-deployment.yaml | 1 + .../dispatch-router-deployment.yaml | 1 + .../example-data-grid/statefulset.yaml | 1 + .../hono-adapter-amqp-deployment.yaml | 1 + .../hono-adapter-coap-deployment.yaml | 1 + .../hono-adapter-http-deployment.yaml | 1 + .../hono-adapter-lora-deployment.yaml | 1 + .../hono-adapter-mqtt-deployment.yaml | 1 + .../hono-service-auth-deployment.yaml | 1 + ...ono-service-command-router-deployment.yaml | 1 + ...o-service-device-registry-statefulset.yaml | 1 + ...no-service-device-registry-deployment.yaml | 1 + ...no-service-device-registry-deployment.yaml | 1 + .../templates/jaeger/jaeger-deployment.yaml | 1 + charts/hono/values.yaml | 23 +++++++++++++++++++ 18 files changed, 56 insertions(+), 1 deletion(-) diff --git a/charts/hono/Chart.yaml b/charts/hono/Chart.yaml index 67038019..a8714ed7 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: 2.5.1 +version: 2.5.2 # Version of Hono being deployed by the chart appVersion: 2.4.0 keywords: diff --git a/charts/hono/README.md b/charts/hono/README.md index bb173873..70c6643b 100644 --- a/charts/hono/README.md +++ b/charts/hono/README.md @@ -102,6 +102,11 @@ helm uninstall eclipse-hono -n hono The command removes all the Kubernetes components associated with the chart and deletes the release. ## Release Notes + +### 2.5.2 + +* Allow setting the priorityClass for all pods to have more control over kubernetes scheduling. + ### 2.5.1 * Allow customizing the PVC storage size for the Device Registry service. diff --git a/charts/hono/templates/_helpers.tpl b/charts/hono/templates/_helpers.tpl index dad02139..ee2da520 100644 --- a/charts/hono/templates/_helpers.tpl +++ b/charts/hono/templates/_helpers.tpl @@ -647,6 +647,19 @@ The scope passed in is expected to be a dict with keys {{- end }} {{- end }} +{{/* +Adds a priority class name to a component's pod spec. +The scope passed in is expected to be a dict with keys +- (mandatory) "name": the name of the component +- (mandatory) "componentConfig": the component's configuration properties as defined in .Values +- (mandatory) "dot": the root scope (".") +*/}} +{{- define "hono.pod.priorityClassName" }} +{{- if .componentConfig.pod.priorityClassName }} +priorityClassName: {{ .componentConfig.pod.priorityClassName | quote }} +{{- end }} +{{- end }} + {{/* Adds port type declarations to a component's service spec. */}} diff --git a/charts/hono/templates/artemis/artemis-deployment.yaml b/charts/hono/templates/artemis/artemis-deployment.yaml index 11790165..d39c7eec 100644 --- a/charts/hono/templates/artemis/artemis-deployment.yaml +++ b/charts/hono/templates/artemis/artemis-deployment.yaml @@ -30,6 +30,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: - name: apache-activemq-artemis image: {{ .Values.amqpMessagingNetworkExample.broker.artemis.imageName | quote }} diff --git a/charts/hono/templates/dispatch-router/dispatch-router-deployment.yaml b/charts/hono/templates/dispatch-router/dispatch-router-deployment.yaml index 6780c701..1cdc4150 100644 --- a/charts/hono/templates/dispatch-router/dispatch-router-deployment.yaml +++ b/charts/hono/templates/dispatch-router/dispatch-router-deployment.yaml @@ -30,6 +30,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: - name: apache-qpid-dispatch-router image: {{ .Values.amqpMessagingNetworkExample.dispatchRouter.imageName | quote }} diff --git a/charts/hono/templates/example-data-grid/statefulset.yaml b/charts/hono/templates/example-data-grid/statefulset.yaml index 37757441..a1144f3f 100644 --- a/charts/hono/templates/example-data-grid/statefulset.yaml +++ b/charts/hono/templates/example-data-grid/statefulset.yaml @@ -30,6 +30,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: - image: {{ .Values.dataGridExample.imageName | quote }} imagePullPolicy: IfNotPresent diff --git a/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-deployment.yaml b/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-deployment.yaml index 0a17931a..3da5f15f 100644 --- a/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-deployment.yaml +++ b/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-deployment.yaml @@ -34,6 +34,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} diff --git a/charts/hono/templates/hono-adapter-coap/hono-adapter-coap-deployment.yaml b/charts/hono/templates/hono-adapter-coap/hono-adapter-coap-deployment.yaml index affba2e7..681c9887 100644 --- a/charts/hono/templates/hono-adapter-coap/hono-adapter-coap-deployment.yaml +++ b/charts/hono/templates/hono-adapter-coap/hono-adapter-coap-deployment.yaml @@ -34,6 +34,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} diff --git a/charts/hono/templates/hono-adapter-http/hono-adapter-http-deployment.yaml b/charts/hono/templates/hono-adapter-http/hono-adapter-http-deployment.yaml index 3085820b..17123106 100644 --- a/charts/hono/templates/hono-adapter-http/hono-adapter-http-deployment.yaml +++ b/charts/hono/templates/hono-adapter-http/hono-adapter-http-deployment.yaml @@ -34,6 +34,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} diff --git a/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-deployment.yaml b/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-deployment.yaml index 18904e82..dec93bbf 100644 --- a/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-deployment.yaml +++ b/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-deployment.yaml @@ -34,6 +34,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} diff --git a/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-deployment.yaml b/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-deployment.yaml index 8e3574c1..b766d84d 100644 --- a/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-deployment.yaml +++ b/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-deployment.yaml @@ -34,6 +34,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} diff --git a/charts/hono/templates/hono-service-auth/hono-service-auth-deployment.yaml b/charts/hono/templates/hono-service-auth/hono-service-auth-deployment.yaml index 34be1f47..84f00d6a 100644 --- a/charts/hono/templates/hono-service-auth/hono-service-auth-deployment.yaml +++ b/charts/hono/templates/hono-service-auth/hono-service-auth-deployment.yaml @@ -33,6 +33,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.container" $args | indent 6 }} {{- with $args.componentConfig.cmdLineArgs }} diff --git a/charts/hono/templates/hono-service-command-router/hono-service-command-router-deployment.yaml b/charts/hono/templates/hono-service-command-router/hono-service-command-router-deployment.yaml index 06f71c10..f1c6843c 100644 --- a/charts/hono/templates/hono-service-command-router/hono-service-command-router-deployment.yaml +++ b/charts/hono/templates/hono-service-command-router/hono-service-command-router-deployment.yaml @@ -33,6 +33,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} 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 d050b7b3..1581389e 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 @@ -34,6 +34,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} 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 1aac1051..1346b561 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 @@ -34,6 +34,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} 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 8763dedd..2e39369e 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 @@ -34,6 +34,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: {{- include "hono.otel.agent" . | indent 6 }} {{- include "hono.container" $args | indent 6 }} diff --git a/charts/hono/templates/jaeger/jaeger-deployment.yaml b/charts/hono/templates/jaeger/jaeger-deployment.yaml index d0ab0227..34db9172 100644 --- a/charts/hono/templates/jaeger/jaeger-deployment.yaml +++ b/charts/hono/templates/jaeger/jaeger-deployment.yaml @@ -36,6 +36,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- include "hono.pod.priorityClassName" $args | nindent 6 }} containers: - name: jaeger image: {{ .Values.jaegerBackendExample.allInOneImage }} diff --git a/charts/hono/values.yaml b/charts/hono/values.yaml index 4206fcd6..dcc1c2d5 100755 --- a/charts/hono/values.yaml +++ b/charts/hono/values.yaml @@ -298,6 +298,7 @@ adapters: pod: labels: {} annotations: {} + priorityClassName: "" # extraVolumes contains additional kubernetes Volume definitions representing volumes # that can mounted into the container's file system. @@ -425,6 +426,7 @@ adapters: pod: labels: {} annotations: {} + priorityClassName: "" # extraVolumes contains additional kubernetes Volume definitions representing volumes # that can mounted into the container's file system. @@ -550,6 +552,7 @@ adapters: pod: labels: {} annotations: {} + priorityClassName: "" # extraVolumes contains additional kubernetes Volume definitions representing volumes # that can mounted into the container's file system. @@ -677,6 +680,7 @@ adapters: pod: labels: {} annotations: {} + priorityClassName: "" # extraVolumes contains additional kubernetes Volume definitions representing volumes # that can mounted into the container's file system. @@ -803,6 +807,7 @@ adapters: pod: labels: {} annotations: {} + priorityClassName: "" # extraVolumes contains additional kubernetes Volume definitions representing volumes # that can mounted into the container's file system. @@ -926,6 +931,7 @@ authServer: pod: labels: {} annotations: {} + priorityClassName: "" # extraVolumes contains additional kubernetes Volume definitions representing volumes # that can mounted into the container's file system. @@ -1192,6 +1198,7 @@ deviceRegistryExample: pod: labels: {} annotations: {} + priorityClassName: "" # The configMap to get additional environment variables from for this device registry. envConfigMap: @@ -1249,6 +1256,8 @@ deviceRegistryExample: limits: cpu: "1" memory: "400Mi" + + # 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. @@ -1275,6 +1284,7 @@ deviceRegistryExample: pod: labels: {} annotations: {} + priorityClassName: "" # jdbcBasedDeviceRegistry contains configuration properties specific to the # jdbc based device registry. @@ -1335,6 +1345,7 @@ deviceRegistryExample: pod: labels: {} annotations: {} + priorityClassName: "" registry: jdbc: @@ -1488,6 +1499,7 @@ commandRouterService: pod: labels: {} annotations: {} + priorityClassName: "" # extraVolumes contains additional kubernetes Volume definitions representing volumes # that can mounted into the container's file system. @@ -1850,6 +1862,9 @@ amqpMessagingNetworkExample: periodSeconds: 5 initialDelaySeconds: 20 + pod: + priorityClassName: "" + svc: annotations: {} loadBalancerIP: @@ -1946,6 +1961,9 @@ amqpMessagingNetworkExample: cpu: "1" memory: "600Mi" + pod: + priorityClassName: "" + # extraVolumes contains additional kubernetes Volume definitions representing volumes # that can mounted into the container's file system. # The syntax is defined in https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volume-v1-core @@ -2016,6 +2034,10 @@ dataGridExample: limits: cpu: "1" memory: "200Mi" + + pod: + priorityClassName: "" + # authUsername contains the name of the user that is authorized to connect to the example data grid. authUsername: "hono" # authPassword contains the secret of the user that is authorized to connect to the example data grid @@ -2066,6 +2088,7 @@ jaegerBackendExample: pod: labels: {} annotations: {} + priorityClassName: "" # env contains environment variables to set for the Jaeger all-in-one container. # The default variables configure the container to keep up to 100000 traces in memory.