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

Helm enhanchements #1174

Merged
merged 34 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
add7211
added possibility to configure the helm chart to you can use a extern…
Sep 20, 2022
f905038
updated README
Sep 20, 2022
ab5a0f4
added possibility to not specify the secret for tls
Sep 23, 2022
69a207b
added the possibility to add annonations to the svc for mqtt; this be…
Sep 23, 2022
10a4637
Added LoadBalancer to mqtt service
Sep 23, 2022
2b5f7d1
Updated README
Sep 23, 2022
bb2158c
removed annotation test
Sep 23, 2022
ab198f2
added minor fix
Sep 23, 2022
7e40662
added ClusterIp as default and in service config
Oct 11, 2022
81e6d5a
updated readme on ClusterIp
Oct 11, 2022
8fb7ca5
updated readme with correct explanation about serviceType
Oct 11, 2022
08b660d
set tls to false for default implementation
Dec 6, 2022
253e786
attempt fixing merge conflicts
Dec 6, 2022
d0d1191
Merge branch 'v2.x' into helm-enhanchements
MichaelTrip Dec 6, 2022
4e644f4
added possibility to configure the helm chart to you can use a extern…
Sep 20, 2022
39bad53
updated README
Sep 20, 2022
1006e4c
added possibility to not specify the secret for tls
Sep 23, 2022
69911a0
added the possibility to add annonations to the svc for mqtt; this be…
Sep 23, 2022
84f1976
Added LoadBalancer to mqtt service
Sep 23, 2022
93ca190
Updated README
Sep 23, 2022
c76227f
added ClusterIp as default and in service config
Oct 11, 2022
a2039f2
updated readme on ClusterIp
Oct 11, 2022
65f59b6
updated readme with correct explanation about serviceType
Oct 11, 2022
db4806c
set tls to false for default implementation
Dec 6, 2022
6551874
attempt fixing merge conflicts
Dec 6, 2022
2904aa8
Bump httpclient from 4.5.13 to 4.5.14
dependabot[bot] Dec 5, 2022
2c6a4be
Bump dependency-check-maven from 7.3.1 to 7.4.0
dependabot[bot] Dec 5, 2022
97e76cb
Bump maven-dependency-plugin from 3.3.0 to 3.4.0
dependabot[bot] Nov 30, 2022
02f6c29
fixed merge conflicts
Dec 6, 2022
42e8d61
removed double HTTP
Dec 9, 2022
098aeec
fixed persistence_db_driver
Dec 9, 2022
e881746
fixed typo and changed default value in README
Dec 9, 2022
1b8a18c
changed default value for serviceType in values to NodePort
Dec 9, 2022
8f99265
removed double section mqtt from values.yaml
Dec 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions helm/frost-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Declare the Helm repo or update it

Install the FROST-Server chart

$ helm install fraunhoferiosb/frost-server
$ helm install fraunhoferiosb/frost-server


## Introduction
Expand Down Expand Up @@ -40,7 +40,7 @@ Before to go, declare the Helm repo or update it

Then, to install the chart with the [release name](https://docs.helm.sh/using_helm/#quickstart-guide) `my-release`

$ helm install --name my-release fraunhoferiosb/frost-server
$ helm install --name my-release fraunhoferiosb/frost-server

This command deploys FROST-Server on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.

Expand Down Expand Up @@ -187,6 +187,8 @@ The following table lists the configurable parameters of the FROST-Server chart
| `frost.http.resources.limits.memory` | Memory limit for the http module. | `NIL` |
| `frost.db.ports.postgresql.servicePort` | The internal port of the FROST-Server database service. | `5432` |
| `frost.db.persistence.enabled` | If data persistence needs to be enabled. See [bellow](#persistence) for more information. | `false` |
|`frost.db.enableIntegratedDb` | If set, the Helm chart will deploy a internal Postgis database server. When disabled, you can use the value below to specify a external connection string. | `true`|
|`frost.db.dbExternalConnectionString` | If the setting `frost.db.enableIntegratedDb` is set to true, you can specify the connection to connect to an external Postgres / PostGIS database| `jdbc:postgresql://externaldbhost:5432/sensorthings` |
| `frost.db.persistence.existingClaim` | If set, then use an existing [PersistenceVolumeClaim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#lifecycle-of-a-volume-and-claim) for the FROST-Server database volume. See [bellow](#persistence) for more information. | `nil` (use the builtin PersistenceVol) |
| `frost.db.persistence.storageClassName` | The [StorageClassName](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class) to use by the FROST-Server database persistence. See [bellow](#persistence) for more information. | `nil` (use the default StorageClass currently in use) |
| `frost.db.persistence.accessModes` | List of [AccessModes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) to claim if FROST-Server database persistence is enabled. See [bellow](#persistence) for more information. | `{ReadWriteOnce}` |
Expand All @@ -211,7 +213,9 @@ The following table lists the configurable parameters of the FROST-Server chart
| `frost.db.requiredHostname` | If this is set, an affinity rule will be added, so that the database pod will only be scheduled on the node with this hostname. | `nil` |
| `frost.db.driver` | The Database driver to use when not using JNDI. | `org.postgresql.Driver` |
| `frost.mqtt.enabled` | If MQTT support needs to be enabled. See [bellow](#mqtt) for more information. | `true` |
|`frost.mqtt.annotations` | It is possible to set certain annotation for the service. This can be handy when using `metallb` as a LoadBalancer. With the annotation option it is possible to set a static ip address for the service. | `true`
| `frost.mqtt.replicas` | The number of FROST-Server MQTT module replicas. | `1` |
|`frost.mqtt.serviceType` | The `serviceType` that Kubernetes will use when deploying the mqtt service. This can either be `NodePort` or `LoadBalancer`. When choosing `LoadBalancer` the service will directly be exposed on a separate ip address by the loadbalancer. This can be useful in cloud environments on if you run `metallb` for example. When using `metallb` you can optionally set a annotation so you can specify a specific ip address to the service. | `NodePort` |
| `frost.mqtt.ports.mqtt.nodePort` | The external port (node port) of the FROST-Server MQTT service. | `nil` (port selected by Kubernetes) |
| `frost.mqtt.ports.mqtt.servicePort` | The internal port of the FROST-Server MQTT service. | `1883` |
| `frost.mqtt.ports.websocket.nodePort` | The external port (node port) of the FROST-Server MQTT websocket service. | `nil` (port selected by Kubernetes) |
Expand Down Expand Up @@ -299,7 +303,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

# example for staging
$ helm install --name my-release -f values.yaml fraunhoferiosb/frost-server
$ helm install --name my-release -f values.yaml fraunhoferiosb/frost-server

> **Tip**: You can use the default [values.yaml](./values.yaml)

Expand Down Expand Up @@ -355,7 +359,7 @@ Once Ingress is enabled on the FROST-Server HTTP component, then the FROST-Serve

> **Warning**: `frost.http.serviceHost` needs to be a DNS name. Make sure to be able to resolve it by adding a rule either in your DNS server or in your local DNS resolver (e.g. `/etc/hosts` in Unix-based environments).

Since the HTTP endpoint of FROST is reachable under the `/FROST-Server`-path, we leverage the Ingress rewriting capability.
Since the HTTP endpoint of FROST is reachable under the `/FROST-Server`-path, we leverage the Ingress rewriting capability.

**Caution: Our configuration is specific for nginx ingress controller version 0.22.0 or above. It needs to be adjusted, if another ingress controller is used.**

Expand All @@ -367,4 +371,4 @@ The FROST-Server MQTT component can be accessed through an [Ingress controller](

$ helm install --set frost.mqtt.ingress.enabled=true fraunhoferiosb/frost-server

**Caution: Our configuration is specific for nginx ingress controller.**
**Caution: Our configuration is specific for nginx ingress controller.**
2 changes: 2 additions & 0 deletions helm/frost-server/templates/db-backup-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.frost.db.enableIntegratedDb -}}
{{- if .Values.frost.backup.enabled -}}
{{- $tier := "db" -}}
{{- $fullName := include "frost-server.fullName" (merge (dict "tier" $tier) .) -}}
Expand Down Expand Up @@ -59,4 +60,5 @@ spec:
- name: {{ $fullName }}
persistentVolumeClaim:
claimName: {{ default (list $fullName "backup" | join "-") .Values.frost.backup.persistence.existingClaim }}
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions helm/frost-server/templates/db-backup-volume-claim.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.frost.db.enableIntegratedDb -}}
{{- if and .Values.frost.backup.enabled (not .Values.frost.backup.persistence.existingClaim) -}}
{{- $tier := "db" -}}
{{- $fullName := include "frost-server.fullName" (merge (dict "tier" $tier) .) -}}
Expand All @@ -22,4 +23,5 @@ spec:
{{- range .Values.frost.backup.persistence.accessModes }}
- {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions helm/frost-server/templates/db-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.frost.db.enableIntegratedDb -}}
{{- $tier := "db" -}}
{{- $fullName := include "frost-server.fullName" (merge (dict "tier" $tier) .) -}}
apiVersion: apps/v1
Expand Down Expand Up @@ -80,3 +81,4 @@ spec:
path: {{ .Values.frost.db.persistence.hostPath }}
type: ""
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions helm/frost-server/templates/db-local-volume.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.frost.db.enableIntegratedDb -}}
{{- if .Values.frost.db.persistence.enabled -}}
{{- if .Values.frost.db.persistence.storageClassName -}}
{{- if eq .Values.frost.db.persistence.storageClassName "frost-server-db-local" -}}
Expand All @@ -23,4 +24,5 @@ spec:
path: {{ .Values.frost.db.persistence.local.nodeMountPath }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
4 changes: 3 additions & 1 deletion helm/frost-server/templates/db-service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.frost.db.enableIntegratedDb -}}
{{- $tier := "db" -}}
{{- $fullName := include "frost-server.fullName" (merge (dict "tier" $tier) .) -}}
apiVersion: v1
Expand All @@ -20,4 +21,5 @@ spec:
ports:
- name: postgresql
port: {{ .Values.frost.db.ports.postgresql.servicePort }}
targetPort: postgresql
targetPort: postgresql
{{- end -}}
2 changes: 2 additions & 0 deletions helm/frost-server/templates/db-volume-claim.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.frost.db.enableIntegratedDb -}}
{{- if and .Values.frost.db.persistence.enabled (not .Values.frost.db.persistence.existingClaim) -}}
{{- $tier := "db" -}}
{{- $fullName := include "frost-server.fullName" (merge (dict "tier" $tier) .) -}}
Expand All @@ -22,4 +23,5 @@ spec:
{{- range .Values.frost.db.persistence.accessModes }}
- {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
5 changes: 5 additions & 0 deletions helm/frost-server/templates/http-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,13 @@ spec:
value: ""
- name: persistence_db_driver
value: "{{ .Values.frost.db.driver }}"
{{ if .Values.frost.db.enableIntegratedDb }}
- name: persistence_db_url
value: {{ printf "jdbc:postgresql://%s:5432/%s" (include "frost-server.fullName" (merge (dict "tier" "db") .)) .Values.frost.db.database | quote }}
{{ else }}
- name: persistence_db_url
value: "{{ .Values.frost.db.dbExternalConnectionString }}"
{{ end }}
MichaelTrip marked this conversation as resolved.
Show resolved Hide resolved
- name: persistence_persistenceManagerImplementationClass
value: "{{ .Values.frost.db.implementationClass }}"
- name: persistence_countMode
Expand Down
2 changes: 2 additions & 0 deletions helm/frost-server/templates/http-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ spec:
tls:
- hosts:
- {{ .Values.frost.http.serviceHost }}
{{- if .Values.frost.http.ingress.tls.secretName }}
secretName: {{ .Values.frost.http.ingress.tls.secretName }}
{{- end -}}
{{- end }}
rules:
- host: {{ .Values.frost.http.serviceHost }}
Expand Down
29 changes: 28 additions & 1 deletion helm/frost-server/templates/mqtt-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ metadata:
helm.sh/chart: {{ include "frost-server.chart" . }}
app: {{ include "frost-server.name" . }}
component: {{ $tier }}
{{- if .Values.frost.mqtt.annotations }}
annotations:
{{- toYaml .Values.frost.mqtt.annotations | nindent 4 -}}
{{- end }}
spec:
selector:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
helm.sh/chart: {{ include "frost-server.chart" . }}
app: {{ include "frost-server.name" . }}
component: {{ $tier }}
component: {{ $tier -}}
{{- if eq .Values.frost.mqtt.serviceType "NodePort" }}
type: NodePort
ports:
- name: mqtt
Expand All @@ -28,6 +33,28 @@ spec:
port: {{ .Values.frost.mqtt.ports.websocket.servicePort }}
nodePort: {{ .Values.frost.mqtt.ports.websocket.nodePort }}
targetPort: websocket
{{ end }}
{{- if eq .Values.frost.mqtt.serviceType "LoadBalancer" }}
type: LoadBalancer
MichaelTrip marked this conversation as resolved.
Show resolved Hide resolved
ports:
- name: mqtt
port: {{ .Values.frost.mqtt.ports.mqtt.servicePort }}
targetPort: mqtt
- name: websocket
port: {{ .Values.frost.mqtt.ports.websocket.servicePort }}
targetPort: websocket
{{- end }}
{{- if eq .Values.frost.mqtt.serviceType "ClusterIp" }}
type: ClusterIp
ports:
- name: mqtt
port: {{ .Values.frost.mqtt.ports.mqtt.servicePort }}
targetPort: mqtt
- name: websocket
port: {{ .Values.frost.mqtt.ports.websocket.servicePort }}
targetPort: websocket
{{- end }}

# MQTT server stores the subscriptions and the client should connect to the same server after the connection is lost
sessionAffinity: ClientIP
sessionAffinityConfig:
Expand Down
6 changes: 5 additions & 1 deletion helm/frost-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ frost:
annotations:
tls:
enabled: false
secretName:
secretName: []

# FROST-Server HTTP deployment resource option. An empty resources field will default to the limits of the namespace.
resources:
Expand Down Expand Up @@ -178,6 +178,8 @@ frost:
pullPolicy: IfNotPresent
# FROST-Server MQTT deployment settings
enabled: true
annotations: {}
serviceType: NodePort
replicas: 1
ports:
mqtt:
Expand Down Expand Up @@ -241,6 +243,8 @@ frost:
# FROST-Server Database module configuration #
##############################################
db:
enableIntegratedDb: true
dbExternalConnectionString: "jdbc:postgresql://externaldbhost:5432/sensorthings"
image:
registry: docker.io
repository: postgis/postgis
Expand Down