From 26c0e2521da311587adf9b5b47815d8ffeeabb4f Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Fri, 23 Feb 2024 13:18:31 +0100 Subject: [PATCH 1/3] Make it possible to disable SSE --- charts/ocis/docs/values-desc-table.adoc | 6 ++++++ charts/ocis/docs/values.adoc.yaml | 3 +++ charts/ocis/templates/frontend/deployment.yaml | 3 +++ charts/ocis/templates/userlog/deployment.yaml | 3 +++ charts/ocis/values.yaml | 3 +++ 5 files changed, 18 insertions(+) diff --git a/charts/ocis/docs/values-desc-table.adoc b/charts/ocis/docs/values-desc-table.adoc index a0f13709b..78ab9911e 100644 --- a/charts/ocis/docs/values-desc-table.adoc +++ b/charts/ocis/docs/values-desc-table.adoc @@ -222,6 +222,12 @@ a| [subs=-attributes] a| [subs=-attributes] `false` | Create demo users on the first startup. Not recommended for production installations. +| features.disableSse +a| [subs=-attributes] ++bool+ +a| [subs=-attributes] +`false` +| Disables server-sent events (sse). When disabled, clients will no longer receive sse notifications. | features.edition a| [subs=-attributes] +string+ diff --git a/charts/ocis/docs/values.adoc.yaml b/charts/ocis/docs/values.adoc.yaml index 46ff22174..2b0a26d51 100644 --- a/charts/ocis/docs/values.adoc.yaml +++ b/charts/ocis/docs/values.adoc.yaml @@ -186,6 +186,9 @@ features: # -- Reference to a ConfigMap containing images that can be referenced from the html mail template. # This ConfigMap is optional and can be omitted when images are not used. htmlMailImagesConfigRef: "html-mail-images" + # -- Disables server-sent events (sse). When disabled, clients will no longer receive sse notifications. + disableSse: false + # Sharing related settings sharing: # Sharing with users related settings diff --git a/charts/ocis/templates/frontend/deployment.yaml b/charts/ocis/templates/frontend/deployment.yaml index 0199c6978..c956dfb2e 100644 --- a/charts/ocis/templates/frontend/deployment.yaml +++ b/charts/ocis/templates/frontend/deployment.yaml @@ -94,6 +94,9 @@ spec: - name: FRONTEND_FULL_TEXT_SEARCH_ENABLED value: {{ not (eq .Values.services.search.extractor.type "basic") | quote }} + - name: OCIS_DISABLE_SSE + value: {{ .Values.features.disableSse | quote }} + # cache # the stat cache is disabled for now for performance reasons, see https://github.com/owncloud/ocis-charts/issues/214 - name: FRONTEND_OCS_STAT_CACHE_STORE diff --git a/charts/ocis/templates/userlog/deployment.yaml b/charts/ocis/templates/userlog/deployment.yaml index 9371ed697..de336bfb6 100644 --- a/charts/ocis/templates/userlog/deployment.yaml +++ b/charts/ocis/templates/userlog/deployment.yaml @@ -83,6 +83,9 @@ spec: name: {{ include "secrets.jwtSecret" . }} key: jwt-secret + - name: OCIS_DISABLE_SSE + value: {{ .Values.features.disableSse | quote }} + {{- include "ocis.livenessProbe" . | nindent 10 }} resources: {{ toYaml .resources | nindent 12 }} diff --git a/charts/ocis/values.yaml b/charts/ocis/values.yaml index 656b12b04..80f1566a9 100644 --- a/charts/ocis/values.yaml +++ b/charts/ocis/values.yaml @@ -185,6 +185,9 @@ features: # -- Reference to a ConfigMap containing images that can be referenced from the html mail template. # This ConfigMap is optional and can be omitted when images are not used. htmlMailImagesConfigRef: "html-mail-images" + # -- Disables server-sent events (sse). When disabled, clients will no longer receive sse notifications. + disableSse: false + # Sharing related settings sharing: # Sharing with users related settings From 76ecd1a5ed0ea83141f5223d06a194c3a7ca65cd Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Mon, 26 Feb 2024 15:49:29 +0100 Subject: [PATCH 2/3] added conditional running of the SSE service --- charts/ocis/docs/values.adoc.yaml | 1 + charts/ocis/templates/sse/deployment.yaml | 2 ++ charts/ocis/templates/sse/hpa.yaml | 2 ++ charts/ocis/templates/sse/pdb.yaml | 2 ++ charts/ocis/values.yaml | 1 + 5 files changed, 8 insertions(+) diff --git a/charts/ocis/docs/values.adoc.yaml b/charts/ocis/docs/values.adoc.yaml index 2b0a26d51..8218003f3 100644 --- a/charts/ocis/docs/values.adoc.yaml +++ b/charts/ocis/docs/values.adoc.yaml @@ -186,6 +186,7 @@ features: # -- Reference to a ConfigMap containing images that can be referenced from the html mail template. # This ConfigMap is optional and can be omitted when images are not used. htmlMailImagesConfigRef: "html-mail-images" + # -- Disables server-sent events (sse). When disabled, clients will no longer receive sse notifications. disableSse: false diff --git a/charts/ocis/templates/sse/deployment.yaml b/charts/ocis/templates/sse/deployment.yaml index 5a1bb7dbd..6ff294344 100644 --- a/charts/ocis/templates/sse/deployment.yaml +++ b/charts/ocis/templates/sse/deployment.yaml @@ -1,3 +1,4 @@ +{{ if not .Values.features.disableSse }} {{- include "ocis.basicServiceTemplates" (dict "scope" . "appName" "appNameSSE" "appNameSuffix" "") -}} apiVersion: apps/v1 kind: Deployment @@ -89,3 +90,4 @@ spec: {{ else }} emptyDir: {} {{ end }} +{{ end }} diff --git a/charts/ocis/templates/sse/hpa.yaml b/charts/ocis/templates/sse/hpa.yaml index 58b58daea..6df45b1e9 100644 --- a/charts/ocis/templates/sse/hpa.yaml +++ b/charts/ocis/templates/sse/hpa.yaml @@ -1,3 +1,5 @@ +{{ if not .Values.features.disableSse }} {{- include "ocis.basicServiceTemplates" (dict "scope" . "appName" "appNameSSE" "appNameSuffix" "") -}} {{- $_ := set . "autoscaling" (default (default (dict) .Values.autoscaling) .Values.services.sse.autoscaling) -}} {{ include "ocis.hpa" . }} +{{ end }} diff --git a/charts/ocis/templates/sse/pdb.yaml b/charts/ocis/templates/sse/pdb.yaml index 8c108c828..bd33abfb7 100644 --- a/charts/ocis/templates/sse/pdb.yaml +++ b/charts/ocis/templates/sse/pdb.yaml @@ -1,2 +1,4 @@ +{{ if not .Values.features.disableSse }} {{- include "ocis.basicServiceTemplates" (dict "scope" . "appName" "appNameSSE" "appNameSuffix" "") -}} {{ include "ocis.pdb" . }} +{{ end }} diff --git a/charts/ocis/values.yaml b/charts/ocis/values.yaml index 80f1566a9..9bde82b43 100644 --- a/charts/ocis/values.yaml +++ b/charts/ocis/values.yaml @@ -185,6 +185,7 @@ features: # -- Reference to a ConfigMap containing images that can be referenced from the html mail template. # This ConfigMap is optional and can be omitted when images are not used. htmlMailImagesConfigRef: "html-mail-images" + # -- Disables server-sent events (sse). When disabled, clients will no longer receive sse notifications. disableSse: false From b9a2d4c1c75ab014860ed931ad0273bf3ce78675 Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Tue, 27 Feb 2024 11:51:54 +0100 Subject: [PATCH 3/3] sse subsection added --- charts/ocis/docs/values-desc-table.adoc | 12 ++++++------ charts/ocis/docs/values.adoc.yaml | 6 ++++-- charts/ocis/templates/frontend/deployment.yaml | 2 +- charts/ocis/templates/sse/deployment.yaml | 2 +- charts/ocis/templates/sse/hpa.yaml | 2 +- charts/ocis/templates/sse/pdb.yaml | 2 +- charts/ocis/templates/userlog/deployment.yaml | 2 +- charts/ocis/values.yaml | 6 ++++-- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/charts/ocis/docs/values-desc-table.adoc b/charts/ocis/docs/values-desc-table.adoc index 78ab9911e..4e1968ef8 100644 --- a/charts/ocis/docs/values-desc-table.adoc +++ b/charts/ocis/docs/values-desc-table.adoc @@ -222,12 +222,6 @@ a| [subs=-attributes] a| [subs=-attributes] `false` | Create demo users on the first startup. Not recommended for production installations. -| features.disableSse -a| [subs=-attributes] -+bool+ -a| [subs=-attributes] -`false` -| Disables server-sent events (sse). When disabled, clients will no longer receive sse notifications. | features.edition a| [subs=-attributes] +string+ @@ -732,6 +726,12 @@ a| [subs=-attributes] a| [subs=-attributes] `3` | Minimum number of characters to enter before a client should start a search for Share receivers. This setting can be used to customize the user experience if e.g too many results are displayed. +| features.sse.disabled +a| [subs=-attributes] ++bool+ +a| [subs=-attributes] +`false` +| Disables SSE. When disabled, clients will no longer receive sse notifications. | features.virusscan.enabled a| [subs=-attributes] +bool+ diff --git a/charts/ocis/docs/values.adoc.yaml b/charts/ocis/docs/values.adoc.yaml index 8218003f3..b8cffb791 100644 --- a/charts/ocis/docs/values.adoc.yaml +++ b/charts/ocis/docs/values.adoc.yaml @@ -187,8 +187,10 @@ features: # This ConfigMap is optional and can be omitted when images are not used. htmlMailImagesConfigRef: "html-mail-images" - # -- Disables server-sent events (sse). When disabled, clients will no longer receive sse notifications. - disableSse: false + # SSE (server-sent events) settings. + sse: + # -- Disables SSE. When disabled, clients will no longer receive sse notifications. + disabled: false # Sharing related settings sharing: diff --git a/charts/ocis/templates/frontend/deployment.yaml b/charts/ocis/templates/frontend/deployment.yaml index c956dfb2e..8c6ae0f57 100644 --- a/charts/ocis/templates/frontend/deployment.yaml +++ b/charts/ocis/templates/frontend/deployment.yaml @@ -95,7 +95,7 @@ spec: value: {{ not (eq .Values.services.search.extractor.type "basic") | quote }} - name: OCIS_DISABLE_SSE - value: {{ .Values.features.disableSse | quote }} + value: {{ .Values.features.sse.disabled | quote }} # cache # the stat cache is disabled for now for performance reasons, see https://github.com/owncloud/ocis-charts/issues/214 diff --git a/charts/ocis/templates/sse/deployment.yaml b/charts/ocis/templates/sse/deployment.yaml index 6ff294344..e3f2d48c2 100644 --- a/charts/ocis/templates/sse/deployment.yaml +++ b/charts/ocis/templates/sse/deployment.yaml @@ -1,4 +1,4 @@ -{{ if not .Values.features.disableSse }} +{{ if not .Values.features.sse.disabled }} {{- include "ocis.basicServiceTemplates" (dict "scope" . "appName" "appNameSSE" "appNameSuffix" "") -}} apiVersion: apps/v1 kind: Deployment diff --git a/charts/ocis/templates/sse/hpa.yaml b/charts/ocis/templates/sse/hpa.yaml index 6df45b1e9..2d806c458 100644 --- a/charts/ocis/templates/sse/hpa.yaml +++ b/charts/ocis/templates/sse/hpa.yaml @@ -1,4 +1,4 @@ -{{ if not .Values.features.disableSse }} +{{ if not .Values.features.sse.disabled }} {{- include "ocis.basicServiceTemplates" (dict "scope" . "appName" "appNameSSE" "appNameSuffix" "") -}} {{- $_ := set . "autoscaling" (default (default (dict) .Values.autoscaling) .Values.services.sse.autoscaling) -}} {{ include "ocis.hpa" . }} diff --git a/charts/ocis/templates/sse/pdb.yaml b/charts/ocis/templates/sse/pdb.yaml index bd33abfb7..0bd3f5f3c 100644 --- a/charts/ocis/templates/sse/pdb.yaml +++ b/charts/ocis/templates/sse/pdb.yaml @@ -1,4 +1,4 @@ -{{ if not .Values.features.disableSse }} +{{ if not .Values.features.sse.disabled }} {{- include "ocis.basicServiceTemplates" (dict "scope" . "appName" "appNameSSE" "appNameSuffix" "") -}} {{ include "ocis.pdb" . }} {{ end }} diff --git a/charts/ocis/templates/userlog/deployment.yaml b/charts/ocis/templates/userlog/deployment.yaml index de336bfb6..77cb1bab8 100644 --- a/charts/ocis/templates/userlog/deployment.yaml +++ b/charts/ocis/templates/userlog/deployment.yaml @@ -84,7 +84,7 @@ spec: key: jwt-secret - name: OCIS_DISABLE_SSE - value: {{ .Values.features.disableSse | quote }} + value: {{ .Values.features.sse.disabled | quote }} {{- include "ocis.livenessProbe" . | nindent 10 }} diff --git a/charts/ocis/values.yaml b/charts/ocis/values.yaml index 9bde82b43..36d1cf4e4 100644 --- a/charts/ocis/values.yaml +++ b/charts/ocis/values.yaml @@ -186,8 +186,10 @@ features: # This ConfigMap is optional and can be omitted when images are not used. htmlMailImagesConfigRef: "html-mail-images" - # -- Disables server-sent events (sse). When disabled, clients will no longer receive sse notifications. - disableSse: false + # SSE (server-sent events) settings. + sse: + # -- Disables SSE. When disabled, clients will no longer receive sse notifications. + disabled: false # Sharing related settings sharing: