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 8 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 @@ -104,7 +104,7 @@ The following table lists the configurable parameters of the FROST-Server chart
|`frost.http.ingress.path` | Value for the `path` of the service in the ingress spec | `/(.*)` |
|`frost.http.ingress.annotations` | Annotations for the ingress definition. E.g. to define the ingress class use ```--set 'frost.http.ingress.annotations.kubernetes\.io/ingress\.class=nginx'``` | `nil` |
|`frost.http.ingress.tls.enabled` | Enable tls for the ingress | `false` |
|`frost.http.ingress.tls.secretName` | Name of the secret used for tls in the ingress definition | `nil` |
|`frost.http.ingress.tls.secretName` | Name of the secret used for tls in the ingress definition. when left blank the ingress controller will try to use it's own certificate. when using `cert-manager` and adding the right `cert-manager` annonations `cert-manager` will try to request a certificate with LetsEncrypt if desired. | `[]` |
phertweck marked this conversation as resolved.
Show resolved Hide resolved
|`frost.http.serviceHost` | The host used by the [`serviceRootURL`](https://github.com/FraunhoferIOSB/FROST-Server/blob/master/docs/settings.adoc#general-settings) mandatory FROST-Server configuration parameter | `frost-server` |
|`frost.http.serviceProtocol` | The protocol where the host will be available | `http` |
|`frost.http.servicePort` | The external port of the FROST-Server HTTP module. If not set standard http(s) port is used, when ingress is enabled. Otherwise `frost.http.ports.http.nodePort` will be used. This value usefull when running a reverse proxy. | `nil` |
Expand Down Expand Up @@ -140,6 +140,8 @@ The following table lists the configurable parameters of the FROST-Server chart
|`frost.db.persistence.mountPath` | The path the volume is mount into the database container. | `/var/lib/postgresql/data` |
|`frost.db.persistence.local.nodeMountPath` | The mount path to use if using the `local` StorageClassName as FROST-Server database StorageClass persistence. See [bellow](#persistence) for more information | `/mnt/frost-server-db` |
|`frost.db.persistence.hostPath` | If `frost.db.persistence.enabled` is set to false. Than this variable can be used to mount this hostPath to the database container. | `nil` |
|`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.database` | The FROST-Server database name to use | `sensorthings` |
|`frost.db.username` | The _base64_ username to use when connecting to the FROST-Server database | `c2Vuc29ydGhpbmdz` (`sensorthings`) |
|`frost.db.password` | The _base64_ password to use when connecting to the FROST-Server database | `bm93eW91Y2FuY2hhbmdlaXQ=` (`nowyoucanchangeit`) |
Expand All @@ -154,7 +156,9 @@ The following table lists the configurable parameters of the FROST-Server chart
|`frost.db.securityContext.fsGroup` | The fsGroup of the database process. | `nil` |
|`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.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.sericeType` | 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. replicas | `1` |
MichaelTrip marked this conversation as resolved.
Show resolved Hide resolved
MichaelTrip marked this conversation as resolved.
Show resolved Hide resolved
|`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 @@ -215,7 +219,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 @@ -271,7 +275,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 Down
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 @@ -89,8 +89,13 @@ spec:
value: ""
- name: persistence_db_driver
value: "org.postgresql.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_idGenerationMode
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
19 changes: 18 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,18 @@ 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 }}

# MQTT server stores the subscriptions and the client should connect to the same server after the connection is lost
sessionAffinity: ClientIP
sessionAffinityConfig:
Expand Down
8 changes: 6 additions & 2 deletions helm/frost-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ frost:
path: /(.*)
annotations:
tls:
enabled: false
secretName:
enabled: true
MichaelTrip marked this conversation as resolved.
Show resolved Hide resolved
secretName: []

# FROST-Server HTTP deployment resource option. An empty resources field will default to the limits of the namespace.
resources:
Expand Down Expand Up @@ -74,6 +74,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 Expand Up @@ -143,7 +145,9 @@ frost:
pullPolicy: IfNotPresent
# FROST-Server MQTT deployment settings
enabled: true
annotations: {}
replicas: 1
serviceType: NodePort
MichaelTrip marked this conversation as resolved.
Show resolved Hide resolved
ports:
mqtt:
nodePort:
Expand Down