diff --git a/helm/flowfuse/Chart.lock b/helm/flowfuse/Chart.lock index 4a972786..e0a81fd2 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.4.1 +digest: sha256:1e13c34b13da4af2417772e3e16a58cc121a626c6b876cb8a6d58d398abb291b +generated: "2025-10-14T17:37:27.179684443+01:00" diff --git a/helm/flowfuse/Chart.yaml b/helm/flowfuse/Chart.yaml index 30f050b2..36482f27 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.4.1 + 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 8e979089..fa92bac1 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 instacne (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) @@ -333,6 +334,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 empty) +- `valkey.port` Port for external Valkey/Redis instance (default empty) +- `valkey.url` Full URL for an external Valkey/Redis instance (default empty) +- `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 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.4.1.tgz b/helm/flowfuse/charts/valkey-0.4.1.tgz new file mode 100644 index 00000000..c099c51d Binary files /dev/null and b/helm/flowfuse/charts/valkey-0.4.1.tgz differ diff --git a/helm/flowfuse/templates/_helpers.tpl b/helm/flowfuse/templates/_helpers.tpl index 21541c44..58ff50a6 100644 --- a/helm/flowfuse/templates/_helpers.tpl +++ b/helm/flowfuse/templates/_helpers.tpl @@ -222,3 +222,26 @@ Generate NPM registry admin password if not provided {{- sha256sum $seed | trunc 25 }} {{- end }} {{- 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 -}} \ No newline at end of file diff --git a/helm/flowfuse/templates/configmap.yaml b/helm/flowfuse/templates/configmap.yaml index 49e6f613..4608de71 100644 --- a/helm/flowfuse/templates/configmap.yaml +++ b/helm/flowfuse/templates/configmap.yaml @@ -316,4 +316,12 @@ data: driver: {{ toYaml .Values.forge.tables.driver | indent 8 }} {{- end -}} - {{- end -}} + {{- end }} + cache: + driver: 'redis' + options: + {{- if .Values.valkey.url }} + url: {{ .Values.valkey.url }} + {{ else }} + url: redis://{{ include "forge.valkeyHost" . }}:{{ include "forge.valkeyPort" . }} + {{- end -}} diff --git a/helm/flowfuse/values.yaml b/helm/flowfuse/values.yaml index 33d869ba..37099fab 100644 --- a/helm/flowfuse/values.yaml +++ b/helm/flowfuse/values.yaml @@ -1,6 +1,7 @@ forge: replicas: 1 localPostgresql: true + localValkey: true https: true projectNamespace: flowforge projectSelector: @@ -344,3 +345,31 @@ npmRegistry: repository: "flowfuse/npm-registry" tag: "latest" podSecurityContext: {} + +valkey: + replicaCount: 1 + + persistence: + enabled: false + size: 20Gi + + resources: + requests: + memory: 512Mi + cpu: 250m + limits: + memory: 1Gi + cpu: 500m + + auth: + enabled: false + + metrics: + enabled: false + serviceMonitor: + enabled: true + + config: + maxMemory: 800mb + maxMemoryPolicy: allkeys-lru + save: 3600 1 300 100 60 10000