Skip to content

Commit

Permalink
allow overriding release name
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Van Haerenborgh <[email protected]>
  • Loading branch information
vhdirk committed Sep 26, 2022
1 parent 8f0a054 commit 8945aa8
Show file tree
Hide file tree
Showing 26 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion charts/hono/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.4
version: 2.1.5
# Version of Hono being deployed by the chart
appVersion: 2.1.0
keywords:
Expand Down
24 changes: 12 additions & 12 deletions charts/hono/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The scope passed in is expected to be a dict with keys
- "component": the value to use for the "app.kubernetes.io/component" label
*/}}
{{- define "hono.metadata" -}}
name: {{ printf "%s-%s" .dot.Release.Name .name | quote }}
name: {{ printf "%s-%s" (include "hono.fullname" .dot ) .name | quote }}
namespace: {{ .dot.Release.Namespace | quote }}
labels:
app.kubernetes.io/name: {{ include "hono.name" .dot | quote }}
Expand Down Expand Up @@ -237,7 +237,7 @@ messaging:
{{- if .dot.Values.amqpMessagingNetworkExample.enabled }}
name: {{ printf "Hono %s" .component | quote }}
amqpHostname: "hono-internal"
host: {{ printf "%s-dispatch-router" .dot.Release.Name | quote }}
host: {{ printf "%s-dispatch-router" ( include "hono.fullname" .dot ) | quote }}
port: 5673
keyPath: {{ .dot.Values.adapters.amqpMessagingNetworkSpec.keyPath | quote }}
certPath: {{ .dot.Values.adapters.amqpMessagingNetworkSpec.certPath | quote }}
Expand All @@ -263,7 +263,7 @@ The scope passed in is expected to be a dict with keys
kafka:
{{- if .dot.Values.kafkaMessagingClusterExample.enabled }}
commonClientConfig:
{{- $bootstrapServers := printf "%[1]s-%[2]s-0.%[1]s-%[2]s-headless:%d" .dot.Release.Name .dot.Values.kafka.nameOverride ( .dot.Values.kafka.service.ports.client | int ) }}
{{- $bootstrapServers := printf "%[1]s-%[2]s-0.%[1]s-%[2]s-headless:%d" ( include "hono.fullname" .dot ) .dot.Values.kafka.nameOverride ( .dot.Values.kafka.service.ports.client | int ) }}
bootstrap.servers: {{ $bootstrapServers | quote }}
{{- if eq .dot.Values.kafka.auth.clientProtocol "sasl_tls" }}
security.protocol: "SASL_SSL"
Expand Down Expand Up @@ -321,7 +321,7 @@ The scope passed in is expected to be a dict with keys
*/}}
{{- define "hono.deviceRegistryExampleClientConfig" -}}
name: {{ printf "Hono %s" .component | quote }}
host: {{ printf "%s-service-device-registry" .dot.Release.Name | quote }}
host: {{ printf "%s-service-device-registry" ( include "hono.fullname" .dot ) | quote }}
port: 5671
credentialsPath: "/opt/hono/config/adapter.credentials"
trustStorePath: {{ .dot.Values.deviceRegistryExample.clientTrustStorePath | default "/opt/hono/tls/ca.crt" | quote }}
Expand All @@ -343,7 +343,7 @@ command:
{{- if .dot.Values.amqpMessagingNetworkExample.enabled }}
name: {{ printf "Hono %s" $adapter | quote }}
amqpHostname: "hono-internal"
host: {{ printf "%s-dispatch-router" .dot.Release.Name | quote }}
host: {{ printf "%s-dispatch-router" ( include "hono.fullname" .dot ) | quote }}
port: 5673
keyPath: {{ .dot.Values.adapters.commandAndControlSpec.keyPath | quote }}
certPath: {{ .dot.Values.adapters.commandAndControlSpec.certPath | quote }}
Expand Down Expand Up @@ -384,7 +384,7 @@ commandRouter:
{{- .dot.Values.adapters.commandRouterSpec | toYaml | nindent 2 }}
{{- else }}
name: {{ printf "Hono %s" $adapter | quote }}
host: {{ printf "%s-service-command-router" .dot.Release.Name | quote }}
host: {{ printf "%s-service-command-router" ( include "hono.fullname" .dot ) | quote }}
port: 5671
credentialsPath: "/opt/hono/config/adapter.credentials"
trustStorePath: {{ .dot.Values.commandRouterService.clientTrustStorePath | default "/opt/hono/tls/ca.crt" | quote }}
Expand Down Expand Up @@ -455,7 +455,7 @@ quarkus:
exporter:
otlp:
{{- if .dot.Values.jaegerBackendExample.enabled }}
endpoint: {{ printf "http://%s-jaeger-collector:4317" .dot.Release.Name | quote }}
endpoint: {{ printf "http://%s-jaeger-collector:4317" ( include "hono.fullname" .dot ) | quote }}
{{- else }}
endpoint: "http://127.0.0.1:4317"
{{- end }}
Expand Down Expand Up @@ -526,7 +526,7 @@ The scope passed in is expected to be a dict with keys
{{- $component := .componentConfig -}}
{{- $probes := mergeOverwrite ( $global.probes | deepCopy ) ( $component.probes | default dict | deepCopy ) -}}
{{- $deprecatedLivenessProbeInitialDelaySeconds := default .dot.Values.livenessProbeInitialDelaySeconds .componentConfig.livenessProbeInitialDelaySeconds -}}
{{- $deprecatedReadinessProbeInitialDelaySeconds := default .dot.Values.readinessProbeInitialDelaySeconds .componentConfig.readinessProbeInitialDelaySeconds -}}
{{- $deprecatedReadinessProbeInitialDelaySeconds := default .dot.Values.readinessProbeInitialDelaySeconds .componentConfig.readinessProbeInitialDelaySeconds -}}
livenessProbe:
httpGet:
path: {{ $probes.livenessProbe.httpGet.path }}
Expand Down Expand Up @@ -604,22 +604,22 @@ The scope passed in is expected to be a dict with keys
{{- if ( ne $keySecretName "none" ) }}
- name: "tls-keys"
secret:
secretName: {{ ternary ( printf "%s-%s-example-keys" .dot.Release.Name .name ) $keySecretName ( eq $keySecretName "example" ) | quote }}
secretName: {{ ternary ( printf "%s-%s-example-keys" ( include "hono.fullname" .dot ) .name ) $keySecretName ( eq $keySecretName "example" ) | quote }}
{{- end }}
{{- $trustStoreConfigMapName := ( default "none" .componentConfig.tlsTrustStoreConfigMap | toString ) }}
{{- if ( ne $trustStoreConfigMapName "none" ) }}
- name: "tls-trust-store"
configMap:
name: {{ ternary ( printf "%s-example-trust-store" .dot.Release.Name ) $trustStoreConfigMapName ( eq $trustStoreConfigMapName "example" ) | quote }}
name: {{ ternary ( printf "%s-example-trust-store" ( include "hono.fullname" .dot )) $trustStoreConfigMapName ( eq $trustStoreConfigMapName "example" ) | quote }}
{{- end }}
- name: "default-logging-config"
configMap:
name: {{ printf "%s-default-logging-config" .dot.Release.Name | quote }}
name: {{ printf "%s-default-logging-config" ( include "hono.fullname" .dot ) | quote }}
optional: true
{{- $volumeName := printf "%s-conf" .name }}
- name: {{ $volumeName | quote }}
secret:
secretName: {{ printf "%s-%s" .dot.Release.Name $volumeName | quote }}
secretName: {{ printf "%s-%s" ( include "hono.fullname" .dot ) $volumeName | quote }}
{{- if and .dot.Values.otelCollectorAgentConfigMap ( not .dot.Values.jaegerBackendExample.enabled ) }}
- name: "otel-collector-config"
configMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ spec:
termination: passthrough
to:
kind: Service
name: {{ .Release.Name }}-dispatch-router-ext
name: {{ include "hono.fullname" . }}-dispatch-router-ext
{{- end }}
6 changes: 3 additions & 3 deletions charts/hono/templates/example-data-grid/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metadata:
{{- include "hono.metadata" $args | nindent 2 }}
spec:
replicas: 1
serviceName: {{ printf "%s-%s" .Release.Name $args.name }}
serviceName: {{ printf "%s-%s" (include "hono.name" $args) $args.name }}
selector:
matchLabels:
{{- include "hono.matchLabels" $args | nindent 6 }}
Expand All @@ -43,7 +43,7 @@ spec:
- name: JDK_JAVA_OPTIONS
value: "-XX:MinRAMPercentage=85 -XX:MaxRAMPercentage=85"
- name: JAVA_OPTIONS
value: {{ printf "-Djgroups.dns.query=%s-%s" .Release.Name $args.name }}
value: {{ printf "-Djgroups.dns.query=%s-%s" (include "hono.name" $args) $args.name }}
ports:
- name: hotrod
containerPort: 11222
Expand Down Expand Up @@ -74,5 +74,5 @@ spec:
volumes:
- name: conf
configMap:
name: {{ printf "%s-%s-conf" .Release.Name $args.name }}
name: {{ printf "%s-%s-conf" (include "hono.name" $args) $args.name }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ spec:
targetPort: amqp
to:
kind: Service
name: {{ .Release.Name }}-adapter-amqp
name: {{ include "hono.fullname" . }}-adapter-amqp
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
termination: passthrough
to:
kind: Service
name: {{ .Release.Name }}-adapter-amqp
name: {{ include "hono.fullname" . }}-adapter-amqp
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ spec:
targetPort: http
to:
kind: Service
name: {{ .Release.Name }}-adapter-http
name: {{ include "hono.fullname" . }}-adapter-http
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
termination: passthrough
to:
kind: Service
name: {{ .Release.Name }}-adapter-http
name: {{ include "hono.fullname" . }}-adapter-http
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ spec:
targetPort: http
to:
kind: Service
name: {{ .Release.Name }}-adapter-lora
name: {{ include "hono.fullname" . }}-adapter-lora
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
termination: passthrough
to:
kind: Service
name: {{ .Release.Name }}-adapter-lora
name: {{ include "hono.name" $args }}-adapter-lora
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ spec:
targetPort: mqtt
to:
kind: Service
name: {{ .Release.Name }}-adapter-mqtt
name: {{ include "hono.fullname" . }}-adapter-mqtt
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
termination: passthrough
to:
kind: Service
name: {{ .Release.Name }}-adapter-mqtt
name: {{ include "hono.fullname" . }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
termination: passthrough
to:
kind: Service
name: {{ .Release.Name }}-service-auth
name: {{ include "hono.fullname" . }}-service-auth
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ spec:
{{- include "hono.component.healthChecks" $args | nindent 8 }}
volumes:
{{- include "hono.pod.volumes" $args | indent 6 }}
serviceAccountName: {{ printf "%s-%s" .Release.Name $args.name | quote }}
serviceAccountName: {{ printf "%s-%s" ( include "hono.fullname" . ) $args.name | quote }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
{{- include "hono.metadata" $args | nindent 2 }}
roleRef:
kind: Role
name: {{ printf "%s-%s" .Release.Name $args.name | quote }}
name: {{ printf "%s-%s" ( include "hono.fullname" . ) $args.name | quote }}
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: {{ printf "%s-%s" .Release.Name $args.name | quote }}
name: {{ printf "%s-%s" ( include "hono.fullname" . ) $args.name | quote }}
namespace: {{ .Release.Namespace }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ spec:
targetPort: 5671
to:
kind: Service
name: {{ .Release.Name}}-service-command-router
name: {{ include "hono.fullname" . }}-service-command-router
{{end}}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ stringData:
{{- if .Values.commandRouterService.hono.auth }}
{{- .Values.commandRouterService.hono.auth | toYaml | nindent 8 }}
{{- else }}
host: {{ printf "%s-service-auth" .Release.Name | quote }}
host: {{ printf "%s-service-auth" ( include "hono.fullname" . ) | quote }}
port: 5671
trustStorePath: "/opt/hono/tls/ca.crt"
hostnameVerificationRequired: false
Expand All @@ -56,7 +56,7 @@ stringData:
{{- .Values.dataGridSpec | toYaml | nindent 12 }}
{{- else if .Values.dataGridExample.enabled }}
remote:
{{- $serverName := printf "%s-data-grid" .Release.Name }}
{{- $serverName := printf "%s-data-grid" ( include "hono.fullname" . ) }}
serverList: {{ printf "%s:11222" $serverName | quote }}
authServerName: {{ $serverName | quote }}
authUsername: {{ .Values.dataGridExample.authUsername | quote }}
Expand All @@ -82,7 +82,7 @@ stringData:
{{- if .Values.amqpMessagingNetworkExample.enabled }}
name: {{ printf "Hono %s" $args.component | quote }}
amqpHostname: hono-internal
host: {{ .Release.Name }}-dispatch-router
host: {{ ( include "hono.fullname" . ) }}-dispatch-router
port: 5673
keyPath: {{ .Values.adapters.commandAndControlSpec.keyPath }}
certPath: {{ .Values.adapters.commandAndControlSpec.certPath }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
termination: passthrough
to:
kind: Service
name: {{ .Release.Name }}-service-device-registry
name: {{ include "hono.fullname" . }}-service-device-registry
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ spec:
targetPort: http
to:
kind: Service
name: {{ .Release.Name }}-service-device-registry
name: {{ include "hono.fullname" . }}-service-device-registry
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
termination: passthrough
to:
kind: Service
name: {{ .Release.Name }}-service-device-registry
name: {{ include "hono.fullname" . }}-service-device-registry
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ metadata:
spec:
template:
metadata:
name: {{ printf "%s-%s" .Release.Name "post-install" | quote }}
name: {{ printf "%s-%s" ( include "hono.fullname" . ) "post-install" | quote }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -48,6 +48,6 @@ spec:
volumes:
- name: post-install-data
configMap:
name: {{ printf "%s-post-install-device-registry-conf" .Release.Name }}
name: {{ include "hono.fullname" . }}"-post-install-device-registry-conf"
defaultMode: 0555
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stringData:
{{- if .Values.deviceRegistryExample.hono.auth }}
{{- .Values.deviceRegistryExample.hono.auth | toYaml | nindent 8 }}
{{- else }}
host: {{ printf "%s-service-auth" .Release.Name | quote }}
host: {{ printf "%s-service-auth" ( include "hono.fullname" . ) | quote }}
port: 5671
trustStorePath: "/opt/hono/tls/ca.crt"
hostnameVerificationRequired: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ spec:
{{- include "hono.pod.volumes" ( dict "dot" $args.dot "name" $args.name "componentConfig" .Values.deviceRegistryExample ) | indent 6 }}
- name: "registry"
persistentVolumeClaim:
claimName: {{ printf "%s-%s" .Release.Name $args.name | quote }}
claimName: {{ printf "%s-%s" ( include "hono.fullname" . ) $args.name | quote }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stringData:
{{- if .Values.deviceRegistryExample.hono.auth }}
{{- .Values.deviceRegistryExample.hono.auth | toYaml | nindent 8 }}
{{- else }}
host: {{ printf "%s-service-auth" .Release.Name | quote }}
host: {{ printf "%s-service-auth" ( include "hono.fullname" . ) | quote }}
port: 5671
trustStorePath: "/opt/hono/tls/ca.crt"
hostnameVerificationRequired: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stringData:
{{- if .Values.deviceRegistryExample.hono.auth }}
{{- .Values.deviceRegistryExample.hono.auth | toYaml | nindent 8 }}
{{- else }}
host: {{ printf "%s-service-auth" .Release.Name | quote }}
host: {{ printf "%s-service-auth" ( include "hono.fullname" . ) | quote }}
port: 5671
trustStorePath: "/opt/hono/tls/ca.crt"
hostnameVerificationRequired: false
Expand Down Expand Up @@ -63,7 +63,7 @@ stringData:
{{- if .Values.deviceRegistryExample.mongoDBBasedDeviceRegistry.mongodb}}
{{- .Values.deviceRegistryExample.mongoDBBasedDeviceRegistry.mongodb | toYaml | nindent 8 }}
{{- else }}
host: {{ printf "%s-%s" .Release.Name .Values.mongodb.nameOverride | quote }}
host: {{ printf "%s-%s" ( include "hono.fullname" . ) .Values.mongodb.nameOverride | quote }}
port: {{ .Values.mongodb.service.port }}
dbName: {{ first .Values.mongodb.auth.databases | quote }}
username: {{ first .Values.mongodb.auth.usernames | quote }}
Expand Down
2 changes: 1 addition & 1 deletion charts/hono/templates/prometheus/prometheus-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ data:
- {{ .Release.Namespace }}
selectors:
- role: pod
label: {{ printf "app.kubernetes.io/instance=%s,helm.sh/chart=%s" .Release.Name ( include "hono.chart" . ) }}
label: {{ printf "app.kubernetes.io/instance=%s,helm.sh/chart=%s" ( include "hono.fullname" . ) ( include "hono.chart" . ) }}
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
Expand Down

0 comments on commit 8945aa8

Please sign in to comment.