From d2d8653ead71fe158810bfcdea76ea0ee3280204 Mon Sep 17 00:00:00 2001 From: Evelyn Gurschler Date: Tue, 5 Mar 2024 09:16:52 +0100 Subject: [PATCH] docs: add operational notes (#49) --- charts/centralidp/values.yaml | 2 +- charts/sharedidp/values.yaml | 2 +- .../13. Operational Notes.md | 60 +++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 docs/technical documentation/13. Operational Notes.md diff --git a/charts/centralidp/values.yaml b/charts/centralidp/values.yaml index 1d53cfa9..e3a1810c 100644 --- a/charts/centralidp/values.yaml +++ b/charts/centralidp/values.yaml @@ -96,7 +96,7 @@ keycloak: - get - list postgresql: - # -- PostgreSQL chart configuration; + # -- PostgreSQL chart configuration (recommended for demonstration purposes only); # default configurations: # host: "centralidp-postgresql-primary", # port: 5432; diff --git a/charts/sharedidp/values.yaml b/charts/sharedidp/values.yaml index d49e5313..204957e8 100644 --- a/charts/sharedidp/values.yaml +++ b/charts/sharedidp/values.yaml @@ -104,7 +104,7 @@ keycloak: - get - list postgresql: - # -- PostgreSQL chart configuration; + # -- PostgreSQL chart configuration (recommended for demonstration purposes only); # default configurations: # host: "sharedidp-postgresql-primary", # port: 5432; diff --git a/docs/technical documentation/13. Operational Notes.md b/docs/technical documentation/13. Operational Notes.md new file mode 100644 index 00000000..fd238640 --- /dev/null +++ b/docs/technical documentation/13. Operational Notes.md @@ -0,0 +1,60 @@ +## Operational Notes + +This document contains operational notes. + +### Postgres subchart for demonstration purposes only + +It's not recommended to use the postgres dependency from Bitnami outside of a demonstration context. + +The helm charts provide the option to connect to an external database. + +### Persistent volume running out of space + +It was observed that the centralIdP Keycloak can quite run easily out of space due the event_entity table logging login requests. + +This was observed in the connection with the postgres dependency from Bitnami which defaults to 8Gi for the persistent volume (for reference within the helm charts this could be postgresql.primary/readReplicas.persistence.size). + +> The general recommendation is to have concepts in place (database maintenance, monitoring, etc.) to prevent this from happening, which is outside of the scope of a reference implementation. + + +#### How to solve + +Expand the persistent volume by requesting more storage within the persistent volume claim (spec.resources.requests.storage). + +[OPTIONAL] In addition also the event_entity table can be cleaned up. + +Useful query to get an overview on the database: + +``` +SELECT relname as table_name, pg_size_pretty(pg_total_relation_size(relid)) as total_size FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC; +``` + +Statements for cleanup: + +``` +// adjust the 'event_time < 1690892701000' accordingly, https://www.epochconverter.com/ + +DELETE FROM +public.event_entity +WHERE id in +(SELECT id FROM public.event_entity +WHERE +event_time < 1690892701000 +ORDER BY +event_time ASC +LIMIT +300000); +``` + +``` +VACUUM FULL +verbose public.event_entity +``` + +## NOTICE + +This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). + +- SPDX-License-Identifier: Apache-2.0 +- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation +- Source URL: https://github.com/eclipse-tractusx/portal-iam