Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#506][#507][#510] Apply Hono chart fixes/improvements #511

Merged
merged 7 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 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.5.3
version: 2.5.4
# Version of Hono being deployed by the chart
appVersion: 2.4.0
keywords:
Expand All @@ -27,7 +27,7 @@ keywords:
home: https://www.eclipse.org/hono/
sources:
- https://github.com/eclipse-hono/hono
icon: https://www.eclipse.org/hono/favicon/favicon-48x48.png
icon: https://eclipse.dev/hono/img/favicon.ico
maintainers:
- name: dejanb
email: [email protected]
Expand All @@ -45,10 +45,10 @@ dependencies:
repository: "https://grafana.github.io/helm-charts"
condition: "grafana.enabled"
- name: "mongodb"
repository: "https://charts.bitnami.com/bitnami"
repository: "oci://registry-1.docker.io/bitnamicharts"
version: "~13.16.x"
condition: "mongodb.createInstance"
- name: "kafka"
repository: "https://charts.bitnami.com/bitnami"
repository: "oci://registry-1.docker.io/bitnamicharts"
version: "^20.x"
condition: "kafkaMessagingClusterExample.enabled"
15 changes: 11 additions & 4 deletions charts/hono/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In addition, a Kubernetes cluster to install the chart to is required.
See the corresponding section on the [IoT Packages prerequisites](https://www.eclipse.org/packages/prereqs/#kubernetes-cluster)
page for information on how to set up a cluster suitable for running Hono.

The Helm chart is being tested to successfully install on the five most recent Kubernetes versions.
The Helm chart is being tested to successfully install on the four most recent Kubernetes versions.

## Installing the chart

Expand Down Expand Up @@ -79,7 +79,7 @@ The following command can then be used to check for the existence of the *DEFAUL
of the installation:

```bash
curl -sIX GET http://$REGISTRY_IP:28080/v1/tenants/DEFAULT_TENANT
curl -skIX GET https://$REGISTRY_IP:28443/v1/tenants/DEFAULT_TENANT
```

the output should look similar to
Expand All @@ -88,7 +88,7 @@ the output should look similar to
HTTP/1.1 200 OK
etag: 89d40d26-5956-4cc6-b978-b15fda5d1823
content-type: application/json; charset=utf-8
content-length: 260
content-length: 445
```

## Uninstalling the Chart
Expand All @@ -102,6 +102,13 @@ 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.4

* Fix Grafana dashboard being empty in case a release name is used that doesn't contain 'hono'.
* Use Bitnami OCI packages in Hono chart dependencies.
* Support using Chart/Release value references in 'deviceRegistryExample.mongoDBBasedDeviceRegistry.mongodb.host'.
* Fix some links, apply README corrections.

### 2.5.3

* Allow configuring pod affinities.
Expand Down Expand Up @@ -218,7 +225,7 @@ In order to set a property to a non-default value, the `--set key=value[,key=val
`helm install`. For example:

```bash
helm install eclipse-hono eclipse-iot/hono -n hono --wait --set useLoadBalancer=false
helm install eclipse-hono eclipse-iot/hono -n hono --wait --set jaegerBackendExample.enabled=true
```

Alternatively, one or more YAML files that contain the properties can be provided when installing the chart:
Expand Down
2 changes: 1 addition & 1 deletion charts/hono/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ NAME {{ "READY STATUS RESTARTS AGE"
Once all pods have reached the READY state, you can start using Hono.

To learn more about Hono's functionality, you should follow the Getting started guide at
https://eclipse.org/hono/getting-started/
https://eclipse.dev/hono/docs/getting-started/

{{- if ( has "kafka" .Values.messagingNetworkTypes ) }}
{{- if .Values.kafkaMessagingClusterExample.enabled }}
Expand Down
9 changes: 2 additions & 7 deletions charts/hono/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019, 2022 Contributors to the Eclipse Foundation
# Copyright (c) 2019, 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand Down Expand Up @@ -286,9 +286,7 @@ The scope passed in is expected to be a dict with keys
kafka:
{{- if .dot.Values.kafkaMessagingClusterExample.enabled }}
commonClientConfig:
{{- $kafkaNameValues := pick .dot.Values.kafka "nameOverride" "fullnameOverride" }}
{{- $kafkaChartDotScope := dict "Release" .dot.Release "Chart" (dict "Name" "kafka") "Values" $kafkaNameValues }}
{{- $bootstrapServers := printf "%[1]s-0.%[1]s-headless:%d" ( include "hono.fullname" $kafkaChartDotScope ) ( .dot.Values.kafka.service.ports.client | int ) }}
{{- $bootstrapServers := printf "%[1]s-0.%[1]s-headless:%d" ( include "common.names.fullname" .dot.Subcharts.kafka ) ( .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 @@ -586,7 +584,6 @@ Adds volume mounts to a component's container.
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
- (optional) "dot": the root scope (".")
- (optional) "configMountPath": the mount path to use for the component's config secret
instead of the default "/opt/hono/config"
*/}}
Expand Down Expand Up @@ -664,9 +661,7 @@ The scope passed in is expected to be a dict with keys
{{/*
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 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if and .Values.deviceRegistryExample.enabled ( eq .Values.deviceRegistryExample.type "mongodb" ) }}
#
# Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation
# Copyright (c) 2020, 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand Down Expand Up @@ -73,7 +73,7 @@ spec:
securityContext:
privileged: false
volumeMounts:
{{- include "hono.container.volumeMounts" ( dict "dot" $args.dot "name" $args.name "componentConfig" .Values.deviceRegistryExample ) | indent 8 }}
{{- include "hono.container.volumeMounts" ( dict "name" $args.name "componentConfig" .Values.deviceRegistryExample ) | indent 8 }}
{{- with ( default .Values.deviceRegistryExample.resources $args.componentConfig.resources ) }}
resources:
{{- . | toYaml | nindent 10 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ stringData:
{{- end }}
mongodb:
{{- if not ( empty .Values.deviceRegistryExample.mongoDBBasedDeviceRegistry.mongodb ) }}
{{- .Values.deviceRegistryExample.mongoDBBasedDeviceRegistry.mongodb | toYaml | nindent 8 }}
{{- tpl ( .Values.deviceRegistryExample.mongoDBBasedDeviceRegistry.mongodb | toYaml ) . | nindent 8 }}
{{- else }}
host: {{ printf "%s-%s" ( include "hono.fullname" . ) .Values.mongodb.nameOverride | quote }}
port: {{ .Values.mongodb.service.port }}
Expand Down
6 changes: 2 additions & 4 deletions charts/hono/templates/kafka/kafka-example-keys.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.kafkaMessagingClusterExample.enabled }}
#
# Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand All @@ -15,9 +15,7 @@ apiVersion: v1
kind: Secret
metadata:
{{/* metadata.name is set to "{fullNameOfKafkaSubChart}-example-keys" here, meaning e.g. "{ReleaseName}-kafka-example-keys", not "{ReleaseName}-hono-example-keys" */}}
{{- $kafkaNameValues := pick .Values.kafka "nameOverride" "fullnameOverride" }}
{{- $kafkaChartDotScope := dict "Release" .Release "Chart" (dict "Name" "kafka" "Version" .Chart.Version "AppVersion" .Chart.AppVersion) "Values" $kafkaNameValues }}
{{- $args := dict "dot" ($kafkaChartDotScope) "component" "kafka" "name" "example-keys" }}
{{- $args := dict "dot" .Subcharts.kafka "component" "kafka" "name" "example-keys" }}
{{- include "hono.metadata" $args | nindent 2 }}
type: Opaque
data:
Expand Down
7 changes: 4 additions & 3 deletions charts/hono/templates/prometheus/prometheus-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.prometheus.createInstance }}
#
# Copyright (c) 2019, 2020 Contributors to the Eclipse Foundation
# Copyright (c) 2019, 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand All @@ -15,7 +15,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
{{- /* prometheus chart expects metadata.name to be "{ReleaseName}-{prometheus.server.configMapOverrideName}" */}}
{{- $prometheusDotScope := . | deepCopy | merge (dict "Values" (dict "fullnameOverride" .Release.Name)) }}
{{- /* letting this name be created via the combination "{$args.Values.fullnameOverride}-{$args.name}" */}}
{{- $prometheusDotScope := dict "Release" .Release "Chart" .Chart "Values" (dict "fullnameOverride" .Release.Name) }}
{{- $args := dict "dot" $prometheusDotScope "component" "metrics" "name" .Values.prometheus.server.configMapOverrideName }}
{{- include "hono.metadata" $args | nindent 2 }}
data:
Expand Down Expand Up @@ -49,7 +50,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" .Release.Name ( include "hono.chart" . ) }}

relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
Expand Down
5 changes: 3 additions & 2 deletions charts/hono/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,8 @@ deviceRegistryExample:

# 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.
# the below section accordingly. Note that the values are processed via the 'tpl' function here,
# allowing for example the inclusion of the release name in the 'host' property.
mongodb: {}
# The host name or IP address of the MongoDB instance.
# host:
Expand Down Expand Up @@ -1756,7 +1757,7 @@ kafka:
enabled: false
# Expose the Kafka service to be accessed from outside the cluster (LoadBalancer service).
# To use service type NodePort instead of LoadBalancer, refer to
# https://github.com/bitnami/charts/tree/master/bitnami/kafka#accessing-kafka-brokers-from-outside-the-cluster
# https://github.com/bitnami/charts/tree/40bf90ef4a52969b9ed8acca3d8a67e90d800673/bitnami/kafka#accessing-kafka-brokers-from-outside-the-cluster
externalAccess:
enabled: true
autoDiscovery:
Expand Down