diff --git a/helm/flowfuse/Chart.lock b/helm/flowfuse/Chart.lock index 4a972786..6664fb81 100644 --- a/helm/flowfuse/Chart.lock +++ b/helm/flowfuse/Chart.lock @@ -2,5 +2,8 @@ dependencies: - name: postgresql repository: https://charts.bitnami.com/bitnami version: 11.9.13 -digest: sha256:1423e37aa789fccab1a4b5db593ccda3887032de2a4814b928df938f6db1de3a -generated: "2024-02-13T12:15:48.820039+01:00" +- name: valkey + repository: oci://registry-1.docker.io/cloudpirates + version: 0.15.3 +digest: sha256:e43b7e22bffb62a4f6c6042e837e5bcb9e7a6e2f5066d96bcf62ce05ef7bab03 +generated: "2026-02-03T16:07:53.32473377Z" diff --git a/helm/flowfuse/Chart.yaml b/helm/flowfuse/Chart.yaml index ea78376d..7f6be15d 100644 --- a/helm/flowfuse/Chart.yaml +++ b/helm/flowfuse/Chart.yaml @@ -16,6 +16,10 @@ dependencies: import-values: - child: image parent: postgresql.image + - name: valkey + version: 0.15.3 + repository: oci://registry-1.docker.io/cloudpirates + condition: forge.localValkey maintainers: - name: "FlowFuse Inc" url: "https://flowfuse.com" diff --git a/helm/flowfuse/README.md b/helm/flowfuse/README.md index 9a095c73..1ae36665 100644 --- a/helm/flowfuse/README.md +++ b/helm/flowfuse/README.md @@ -28,6 +28,7 @@ For other values please refer to the documentation below. - `forge.https` is the Forge App accessed via HTTPS (default `true`) - `forge.registry` the hostname for the container registry used for FlowFuse images and as a fallback for init containers and other images in this chart (default: empty, meaning Docker Hub) - `forge.localPostgresql` Deploy a PostgreSQL v14 Database into Kubernetes cluster (default `true`) + - `forge.localValkey` Deploy a Valkey Cache instance (default `true`) - `forge.initContainers.config.image.registry` optional registry override used only for the "config" init container image; falls back to `forge.registry` when unset - `forge.initContainers.waitForLocalDb.image.registry` optional registry override used only for the "wait-for-local-db" init container image; falls back to `forge.registry` when unset - `forge.cloudProvider` can be `aws` or `openshift` but will include more as needed (default not set) @@ -69,6 +70,7 @@ For other values please refer to the documentation below. - `forge.service.nodePort` allows to set custom nodePort value when `forge.service.type` value is set to `NodePort` (default not set) - `forge.logging.level` sets logging level for the Forge app (default: `info` from "info", "error", "debug", "warn", "trace", "fatal") - `forge.logging.http` sets HTTP request level logging for the Forge app (default: `info` from "info", "error", "debug", "warn", "trace", "fatal") + - `forge.cache.type` sets the shared cache mode (default: `valkey`, alternative `memory`) note: `forge.projectSelector` and `forge.managementSelector` defaults mean that you must have at least 2 nodes in your cluster and they need to be labeled before installing. @@ -355,6 +357,18 @@ Note: External secret must contain following keys: - `postgress-password` - the password to use for the postgres user (equivalent to `postgresql.auth.postgresPassword` key) +### Valkey Shared Cache +- `valkey.host` Hostname for external Valkey/Redis instance (default `-valkey`) +- `valkey.port` Port for external Valkey/Redis instance (default `6379`) +- `valkey.url` Full URL for an external Valkey/Redis instance (default empty, this take priority over `valkey.host` & `valkey.port`) +- `valkey.replicaCount` Number of Valkey instances (default `1`) +- `valkey.persistence.enabled` Should Valkey persist to disk (default `false`) +- `valkey.persistence.size` How large a storage volume should be created if enabled (default `20Gi`) +- `valkey.auth.enabled` Should Valkey require authentication (default `false`) +- `valkey.auth.password` Set a password (default not set, will generate if auth enabled) +- `valkey.metrics.enabled` Enabled metrics endpoint (default `false`) +- `valkey.config` allows to overwrite the default Valkey configuration + ### Liveness, readiness and startup probes Following values can be used to configure the liveness, readiness and startup probes for all pods: diff --git a/helm/flowfuse/charts/valkey-0.15.3.tgz b/helm/flowfuse/charts/valkey-0.15.3.tgz new file mode 100644 index 00000000..52d88a38 Binary files /dev/null and b/helm/flowfuse/charts/valkey-0.15.3.tgz differ diff --git a/helm/flowfuse/templates/_helpers.tpl b/helm/flowfuse/templates/_helpers.tpl index dd39bfd2..4dfd9db4 100644 --- a/helm/flowfuse/templates/_helpers.tpl +++ b/helm/flowfuse/templates/_helpers.tpl @@ -317,4 +317,26 @@ Usage: {{ include "forge.filteredBrokerIngressAnnotations" . }} {{- if $filtered -}} {{- toYaml $filtered -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{/* +Get the valkey host name. +*/}} +{{- define "forge.valkeyHost" -}} +{{- if not .Values.valkey.host -}} + {{- printf "%s-%s" .Release.Name "valkey" }} +{{- else -}} + {{- .Values.valkey.host }} +{{- end -}} +{{- end -}} + +{{/* +Get the valkey port number. +*/}} +{{- define "forge.valkeyPort" -}} +{{- if not .Values.valkey.host -}} + 6379 +{{- else -}} + {{- .Values.valkey.port }} +{{- end -}} +{{- end -}} diff --git a/helm/flowfuse/templates/configmap.yaml b/helm/flowfuse/templates/configmap.yaml index 30641e93..c0095ede 100644 --- a/helm/flowfuse/templates/configmap.yaml +++ b/helm/flowfuse/templates/configmap.yaml @@ -358,4 +358,19 @@ data: driver: {{ toYaml .Values.forge.tables.driver | indent 8 }} {{- end -}} - {{- end -}} + {{- end }} + {{- if and (eq .Values.forge.cache.type "valkey") (not .Values.forge.localValkey) (not .Values.valkey.url) -}} + {{- fail "forge.cache.type=valkey requires either forge.localValkey=true or valkey.url to be set" -}} + {{- end }} + cache: + {{- if eq .Values.forge.cache.type "valkey" }} + driver: 'redis' + options: + {{- if .Values.valkey.url }} + url: {{ .Values.valkey.url }} + {{ else }} + url: redis://{{ include "forge.valkeyHost" . }}:{{ include "forge.valkeyPort" . }} + {{- end -}} + {{- else }} + driver: 'memory' + {{- end -}} diff --git a/helm/flowfuse/values.schema.json b/helm/flowfuse/values.schema.json index ce6d8d1f..ae378006 100644 --- a/helm/flowfuse/values.schema.json +++ b/helm/flowfuse/values.schema.json @@ -1125,6 +1125,17 @@ "enum": ["info", "debug", "error", "trace", "fatal", "warn"] } } + }, + "cache": { + "type": "object", + "properties": { + "type": { + "enum": ["valkey", "memory"] + } + } + }, + "localValkey": { + "type": "boolean" } }, "required": [ diff --git a/helm/flowfuse/values.yaml b/helm/flowfuse/values.yaml index 73611435..329eae1e 100644 --- a/helm/flowfuse/values.yaml +++ b/helm/flowfuse/values.yaml @@ -2,6 +2,7 @@ forge: replicas: 1 revisionHistoryLimit: 10 localPostgresql: true + localValkey: true https: true projectNamespace: flowforge projectSelector: @@ -58,6 +59,8 @@ forge: logging: level: info http: info + cache: + type: valkey persistentStorage: enabled: false @@ -356,3 +359,28 @@ npmRegistry: repository: "flowfuse/npm-registry" tag: "latest" podSecurityContext: {} + +valkey: + replicaCount: 1 + + persistence: + enabled: false + + resources: + requests: + memory: 512Mi + cpu: 250m + limits: + memory: 1Gi + cpu: 500m + + auth: + enabled: false + + metrics: + enabled: false + + config: + maxMemory: 800mb + maxMemoryPolicy: allkeys-lru + save: 3600 1 300 100 60 10000