From a535abb2b8943e283b6d03e83dadee03ed9852c1 Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Mon, 12 Dec 2022 15:45:13 +0100 Subject: [PATCH] fix openshift routes Signed-off-by: Dirk Van Haerenborgh --- .../templates/dispatch-router/dispatch-router-route.yaml | 2 +- .../templates/dispatch-router/dispatch-router-secret.yaml | 1 + charts/hono/templates/example-data-grid/configmap.yaml | 3 ++- charts/hono/templates/example-data-grid/statefulset.yaml | 2 +- .../hono-adapter-amqp/hono-adapter-amqp-route.yaml | 2 +- .../hono-adapter-amqp/hono-adapter-amqp-sec-route.yaml | 2 +- .../hono-adapter-http/hono-adapter-http-route.yaml | 2 +- .../hono-adapter-http/hono-adapter-http-sec-route.yaml | 2 +- .../hono-adapter-lora/hono-adapter-lora-route.yaml | 2 +- .../hono-adapter-lora/hono-adapter-lora-sec-route.yaml | 2 +- .../hono-adapter-mqtt/hono-adapter-mqtt-route.yaml | 2 +- .../hono-adapter-mqtt/hono-adapter-mqtt-sec-route.yaml | 2 +- .../hono-service-auth/hono-service-auth-route.yaml | 2 +- .../hono-service-command-router-rolebinding.yaml | 4 ++-- .../hono-service-command-router-route.yaml | 2 +- .../hono-service-command-router-secret.yaml | 6 +++--- .../hono-service-device-registry-amqps-route.yaml | 2 +- .../hono-service-device-registry-http-route.yaml | 2 +- .../hono-service-device-registry-https-route.yaml | 2 +- charts/hono/templates/prometheus/prometheus-config.yaml | 2 +- 20 files changed, 24 insertions(+), 22 deletions(-) diff --git a/charts/hono/templates/dispatch-router/dispatch-router-route.yaml b/charts/hono/templates/dispatch-router/dispatch-router-route.yaml index 730d7b8b..53656434 100644 --- a/charts/hono/templates/dispatch-router/dispatch-router-route.yaml +++ b/charts/hono/templates/dispatch-router/dispatch-router-route.yaml @@ -24,5 +24,5 @@ spec: termination: passthrough to: kind: Service - name: {{ printf "%s-dispatch-router-ext" ( include "hono.fullname" . ) }} + name: {{ printf "%s-dispatch-router-ext" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/dispatch-router/dispatch-router-secret.yaml b/charts/hono/templates/dispatch-router/dispatch-router-secret.yaml index 78232e42..f021c8cc 100644 --- a/charts/hono/templates/dispatch-router/dispatch-router-secret.yaml +++ b/charts/hono/templates/dispatch-router/dispatch-router-secret.yaml @@ -20,6 +20,7 @@ metadata: type: Opaque stringData: "qdrouterd.json": | + {{- $_ := set $ "dot" $args.dot }} {{- tpl ( .Files.Get "config/router/qdrouterd.json" ) . | nindent 4 }} "broker-password": {{ .Values.amqpMessagingNetworkExample.broker.saslPassword }} {{- end }} diff --git a/charts/hono/templates/example-data-grid/configmap.yaml b/charts/hono/templates/example-data-grid/configmap.yaml index 45059bc5..e958eec7 100644 --- a/charts/hono/templates/example-data-grid/configmap.yaml +++ b/charts/hono/templates/example-data-grid/configmap.yaml @@ -18,7 +18,8 @@ metadata: {{- include "hono.metadata" $args | nindent 2 }} data: hono-data-grid.xml: | - {{- tpl ( .Files.Get "config/infinispan/hono-data-grid.xml" ) . | nindent 4 }} + {{- $_ := set $ "dot" $args.dot }} + {{- tpl ( .Files.Get "config/infinispan/hono-data-grid.xml" ) $ | nindent 4 }} users.properties: | {{ printf "%s=%s" .Values.dataGridExample.authUsername .Values.dataGridExample.authPassword }} public-groups.properties: | diff --git a/charts/hono/templates/example-data-grid/statefulset.yaml b/charts/hono/templates/example-data-grid/statefulset.yaml index f21ac8e0..1a2ba8a6 100644 --- a/charts/hono/templates/example-data-grid/statefulset.yaml +++ b/charts/hono/templates/example-data-grid/statefulset.yaml @@ -74,5 +74,5 @@ spec: volumes: - name: conf configMap: - name: {{ printf "%s-%s-conf" (include "hono.fullname" .) $args.name }} + name: {{ printf "%s-%s-conf" (include "hono.fullname" $args) $args.name }} {{- end }} diff --git a/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-route.yaml b/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-route.yaml index ea7e34de..d50d45e6 100644 --- a/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-route.yaml +++ b/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-route.yaml @@ -21,5 +21,5 @@ spec: targetPort: amqp to: kind: Service - name: {{ printf "%s-adapter-amqp" ( include "hono.fullname" . ) }} + name: {{ printf "%s-adapter-amqp" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-sec-route.yaml b/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-sec-route.yaml index dd3ddbf1..666d9153 100644 --- a/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-sec-route.yaml +++ b/charts/hono/templates/hono-adapter-amqp/hono-adapter-amqp-sec-route.yaml @@ -23,5 +23,5 @@ spec: termination: passthrough to: kind: Service - name: {{ printf "%s-adapter-amqp" ( include "hono.fullname" . ) }} + name: {{ printf "%s-adapter-amqp" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-adapter-http/hono-adapter-http-route.yaml b/charts/hono/templates/hono-adapter-http/hono-adapter-http-route.yaml index 313bc54b..9fd9dfd9 100644 --- a/charts/hono/templates/hono-adapter-http/hono-adapter-http-route.yaml +++ b/charts/hono/templates/hono-adapter-http/hono-adapter-http-route.yaml @@ -21,5 +21,5 @@ spec: targetPort: http to: kind: Service - name: {{ printf "%s-adapter-http" ( include "hono.fullname" . ) }} + name: {{ printf "%s-adapter-http" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-adapter-http/hono-adapter-http-sec-route.yaml b/charts/hono/templates/hono-adapter-http/hono-adapter-http-sec-route.yaml index c4941b39..5f88128f 100644 --- a/charts/hono/templates/hono-adapter-http/hono-adapter-http-sec-route.yaml +++ b/charts/hono/templates/hono-adapter-http/hono-adapter-http-sec-route.yaml @@ -23,5 +23,5 @@ spec: termination: passthrough to: kind: Service - name: {{ printf "%s-adapter-http" ( include "hono.fullname" . ) }} + name: {{ printf "%s-adapter-http" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-route.yaml b/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-route.yaml index cd444fc4..5018dc99 100644 --- a/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-route.yaml +++ b/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-route.yaml @@ -21,5 +21,5 @@ spec: targetPort: http to: kind: Service - name: {{ printf "%s-adapter-lora" ( include "hono.fullname" . ) }} + name: {{ printf "%s-adapter-lora" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-sec-route.yaml b/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-sec-route.yaml index cd276266..fa8ae36c 100644 --- a/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-sec-route.yaml +++ b/charts/hono/templates/hono-adapter-lora/hono-adapter-lora-sec-route.yaml @@ -23,5 +23,5 @@ spec: termination: passthrough to: kind: Service - name: {{ printf "%s-adapter-lora" ( include "hono.fullname" . ) }} + name: {{ printf "%s-adapter-lora" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-route.yaml b/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-route.yaml index b3eea192..11807605 100644 --- a/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-route.yaml +++ b/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-route.yaml @@ -21,5 +21,5 @@ spec: targetPort: mqtt to: kind: Service - name: {{ printf "%s-adapter-mqtt" ( include "hono.fullname" . ) }} + name: {{ printf "%s-adapter-mqtt" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-sec-route.yaml b/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-sec-route.yaml index b10db49f..5155b08a 100644 --- a/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-sec-route.yaml +++ b/charts/hono/templates/hono-adapter-mqtt/hono-adapter-mqtt-sec-route.yaml @@ -23,5 +23,5 @@ spec: termination: passthrough to: kind: Service - name: {{ printf "%s-adapter-mqtt" ( include "hono.fullname" . ) }} + name: {{ printf "%s-adapter-mqtt" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-service-auth/hono-service-auth-route.yaml b/charts/hono/templates/hono-service-auth/hono-service-auth-route.yaml index 1ba037eb..5d8509e7 100644 --- a/charts/hono/templates/hono-service-auth/hono-service-auth-route.yaml +++ b/charts/hono/templates/hono-service-auth/hono-service-auth-route.yaml @@ -23,5 +23,5 @@ spec: termination: passthrough to: kind: Service - name: {{ printf "%s-service-auth" ( include "hono.fullname" . ) }} + name: {{ printf "%s-service-auth" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-service-command-router/hono-service-command-router-rolebinding.yaml b/charts/hono/templates/hono-service-command-router/hono-service-command-router-rolebinding.yaml index ab9c0ae3..bb16d6de 100644 --- a/charts/hono/templates/hono-service-command-router/hono-service-command-router-rolebinding.yaml +++ b/charts/hono/templates/hono-service-command-router/hono-service-command-router-rolebinding.yaml @@ -5,9 +5,9 @@ metadata: {{- include "hono.metadata" $args | nindent 2 }} roleRef: kind: Role - name: {{ printf "%s-%s" ( include "hono.fullname" . ) $args.name | quote }} + name: {{ printf "%s-%s" ( include "hono.fullname" $args ) $args.name | quote }} apiGroup: rbac.authorization.k8s.io subjects: - kind: ServiceAccount - name: {{ printf "%s-%s" ( include "hono.fullname" . ) $args.name | quote }} + name: {{ printf "%s-%s" ( include "hono.fullname" $args ) $args.name | quote }} namespace: {{ .Release.Namespace }} diff --git a/charts/hono/templates/hono-service-command-router/hono-service-command-router-route.yaml b/charts/hono/templates/hono-service-command-router/hono-service-command-router-route.yaml index 931b4f9b..25ea1864 100644 --- a/charts/hono/templates/hono-service-command-router/hono-service-command-router-route.yaml +++ b/charts/hono/templates/hono-service-command-router/hono-service-command-router-route.yaml @@ -21,5 +21,5 @@ spec: targetPort: 5671 to: kind: Service - name: {{ printf "%s-service-command-router" ( include "hono.fullname" . ) }} + name: {{ printf "%s-service-command-router" ( include "hono.fullname" $args ) }} {{end}} diff --git a/charts/hono/templates/hono-service-command-router/hono-service-command-router-secret.yaml b/charts/hono/templates/hono-service-command-router/hono-service-command-router-secret.yaml index 4dab06b2..3205e474 100644 --- a/charts/hono/templates/hono-service-command-router/hono-service-command-router-secret.yaml +++ b/charts/hono/templates/hono-service-command-router/hono-service-command-router-secret.yaml @@ -33,7 +33,7 @@ stringData: {{- if .Values.commandRouterService.hono.auth }} {{- .Values.commandRouterService.hono.auth | toYaml | nindent 8 }} {{- else }} - host: {{ printf "%s-service-auth" ( include "hono.fullname" . ) | quote }} + host: {{ printf "%s-service-auth" ( include "hono.fullname" $args ) | quote }} port: 5671 trustStorePath: "/opt/hono/tls/ca.crt" hostnameVerificationRequired: false @@ -56,7 +56,7 @@ stringData: {{- .Values.dataGridSpec | toYaml | nindent 12 }} {{- else if .Values.dataGridExample.enabled }} remote: - {{- $serverName := printf "%s-data-grid" ( include "hono.fullname" . ) }} + {{- $serverName := printf "%s-data-grid" ( include "hono.fullname" $args ) }} serverList: {{ printf "%s:11222" $serverName | quote }} authServerName: {{ $serverName | quote }} authUsername: {{ .Values.dataGridExample.authUsername | quote }} @@ -82,7 +82,7 @@ stringData: {{- if .Values.amqpMessagingNetworkExample.enabled }} name: {{ printf "Hono %s" $args.component | quote }} amqpHostname: hono-internal - host: {{ ( include "hono.fullname" . ) }}-dispatch-router + host: {{ ( include "hono.fullname" $args ) }}-dispatch-router port: 5673 keyPath: {{ .Values.adapters.commandAndControlSpec.keyPath }} certPath: {{ .Values.adapters.commandAndControlSpec.certPath }} diff --git a/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-amqps-route.yaml b/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-amqps-route.yaml index d59970f9..c101c6cb 100644 --- a/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-amqps-route.yaml +++ b/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-amqps-route.yaml @@ -23,5 +23,5 @@ spec: termination: passthrough to: kind: Service - name: {{ printf "%s-service-device-registry" ( include "hono.fullname" . ) }} + name: {{ printf "%s-service-device-registry" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-http-route.yaml b/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-http-route.yaml index b896c95a..7b0b0bbe 100644 --- a/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-http-route.yaml +++ b/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-http-route.yaml @@ -21,5 +21,5 @@ spec: targetPort: http to: kind: Service - name: {{ printf "%s-service-device-registry" ( include "hono.fullname" . ) }} + name: {{ printf "%s-service-device-registry" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-https-route.yaml b/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-https-route.yaml index 47e113cd..250418cf 100644 --- a/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-https-route.yaml +++ b/charts/hono/templates/hono-service-device-registry-base/hono-service-device-registry-https-route.yaml @@ -23,5 +23,5 @@ spec: termination: passthrough to: kind: Service - name: {{ printf "%s-service-device-registry" ( include "hono.fullname" . ) }} + name: {{ printf "%s-service-device-registry" ( include "hono.fullname" $args ) }} {{- end }} diff --git a/charts/hono/templates/prometheus/prometheus-config.yaml b/charts/hono/templates/prometheus/prometheus-config.yaml index a2d6288c..24416e18 100644 --- a/charts/hono/templates/prometheus/prometheus-config.yaml +++ b/charts/hono/templates/prometheus/prometheus-config.yaml @@ -47,7 +47,7 @@ data: - {{ .Release.Namespace }} selectors: - role: pod - label: {{ printf "app.kubernetes.io/instance=%s,helm.sh/chart=%s" ( include "hono.fullname" . ) ( include "hono.chart" . ) }} + label: {{ printf "app.kubernetes.io/instance=%s,helm.sh/chart=%s" ( include "hono.fullname" $args ) ( include "hono.chart" $args ) }} relabel_configs: - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]