diff --git a/roles/gitlab/templates/pg-cluster-gitlab.yaml.j2 b/roles/gitlab/templates/pg-cluster-gitlab.yaml.j2 index b060cf01..32eba9f3 100644 --- a/roles/gitlab/templates/pg-cluster-gitlab.yaml.j2 +++ b/roles/gitlab/templates/pg-cluster-gitlab.yaml.j2 @@ -25,6 +25,9 @@ spec: postgresql: parameters: max_worker_processes: "60" +{% if dsc.gitlab.postgresWalMaxSlotKeepSize is defined %} + max_slot_wal_keep_size: {{ dsc.gitlab.postgresWalMaxSlotKeepSize }} +{% endif %} {% if dsc.gitlab.cnpg.mode == "primary" %} pg_hba: # To access through TCP/IP you will need to get username diff --git a/roles/harbor/templates/pg-cluster-harbor.yaml.j2 b/roles/harbor/templates/pg-cluster-harbor.yaml.j2 index ef34fa70..d0629b1c 100644 --- a/roles/harbor/templates/pg-cluster-harbor.yaml.j2 +++ b/roles/harbor/templates/pg-cluster-harbor.yaml.j2 @@ -25,6 +25,9 @@ spec: postgresql: parameters: max_worker_processes: "60" +{% if dsc.harbor.postgresWalMaxSlotKeepSize is defined %} + max_slot_wal_keep_size: {{ dsc.harbor.postgresWalMaxSlotKeepSize }} +{% endif %} {% if dsc.harbor.cnpg.mode == "primary" %} pg_hba: # To access through TCP/IP you will need to get username diff --git a/roles/keycloak/templates/pg-cluster-keycloak.yaml.j2 b/roles/keycloak/templates/pg-cluster-keycloak.yaml.j2 index ff011020..2931db80 100644 --- a/roles/keycloak/templates/pg-cluster-keycloak.yaml.j2 +++ b/roles/keycloak/templates/pg-cluster-keycloak.yaml.j2 @@ -25,6 +25,9 @@ spec: postgresql: parameters: max_worker_processes: "60" +{% if dsc.keycloak.postgresWalMaxSlotKeepSize is defined %} + max_slot_wal_keep_size: {{ dsc.keycloak.postgresWalMaxSlotKeepSize }} +{% endif %} {% if dsc.keycloak.cnpg.mode == "primary" %} pg_hba: # To access through TCP/IP you will need to get username diff --git a/roles/socle-config/files/crd-conf-dso.yaml b/roles/socle-config/files/crd-conf-dso.yaml index f62774de..098175fc 100644 --- a/roles/socle-config/files/crd-conf-dso.yaml +++ b/roles/socle-config/files/crd-conf-dso.yaml @@ -219,6 +219,14 @@ spec: description: Size for postgres data pvc. type: string default: 10Gi + postgresWalMaxSlotKeepSize: + description: | + Maximum size of WAL files that replication slots are allowed to retain in the pg_wal directory at checkpoint time. + Default is -1, meaning that replication slots may retain an unlimited amount of WAL files. + You can for instance set it to "9GB". + See: https://cloudnative-pg.io/documentation/current/replication/#capping-the-wal-size-retained-for-replication-slots + Refer to postgresql.conf for memory units. + type: string postgresWalPvcSize: description: Size for postgres wal pvc (if value is not set then WAL files are stored within the data PVC). type: string @@ -301,6 +309,14 @@ spec: description: Size for postgres data pvc. type: string default: 10Gi + postgresWalMaxSlotKeepSize: + description: | + Maximum size of WAL files that replication slots are allowed to retain in the pg_wal directory at checkpoint time. + Default is -1, meaning that replication slots may retain an unlimited amount of WAL files. + You can for instance set it to "9GB". + See: https://cloudnative-pg.io/documentation/current/replication/#capping-the-wal-size-retained-for-replication-slots + Refer to postgresql.conf for memory units. + type: string postgresWalPvcSize: description: Size for postgres wal pvc (if value is not set then WAL files are stored within the data PVC). type: string @@ -763,6 +779,14 @@ spec: description: Size for postgres data pvc. type: string default: 10Gi + postgresWalMaxSlotKeepSize: + description: | + Maximum size of WAL files that replication slots are allowed to retain in the pg_wal directory at checkpoint time. + Default is -1, meaning that replication slots may retain an unlimited amount of WAL files. + You can for instance set it to "9GB". + See: https://cloudnative-pg.io/documentation/current/replication/#capping-the-wal-size-retained-for-replication-slots + Refer to postgresql.conf for memory units. + type: string postgresWalPvcSize: description: Size for postgres wal pvc (if value is not set then WAL files are stored within the data PVC). type: string @@ -899,6 +923,14 @@ spec: description: Size for postgres data pvc. type: string default: 10Gi + postgresWalMaxSlotKeepSize: + description: | + Maximum size of WAL files that replication slots are allowed to retain in the pg_wal directory at checkpoint time. + Default is -1, meaning that replication slots may retain an unlimited amount of WAL files. + You can for instance set it to "9GB". + See: https://cloudnative-pg.io/documentation/current/replication/#capping-the-wal-size-retained-for-replication-slots + Refer to postgresql.conf for memory units. + type: string postgresWalPvcSize: description: Size for postgres wal pvc (if value is not set then WAL files are stored within the data PVC). type: string @@ -1041,6 +1073,14 @@ spec: description: Size for postgres data pvc. type: string default: 10Gi + postgresWalMaxSlotKeepSize: + description: | + Maximum size of WAL files that replication slots are allowed to retain in the pg_wal directory at checkpoint time. + Default is -1, meaning that replication slots may retain an unlimited amount of WAL files. + You can for instance set it to "9GB". + See: https://cloudnative-pg.io/documentation/current/replication/#capping-the-wal-size-retained-for-replication-slots + Refer to postgresql.conf for memory units. + type: string postgresWalPvcSize: description: Size for postgres wal pvc (if value is not set then WAL files are stored within the data PVC). type: string diff --git a/roles/sonarqube/templates/pg-cluster-sonar.yaml.j2 b/roles/sonarqube/templates/pg-cluster-sonar.yaml.j2 index bffb10ae..8c25be4b 100644 --- a/roles/sonarqube/templates/pg-cluster-sonar.yaml.j2 +++ b/roles/sonarqube/templates/pg-cluster-sonar.yaml.j2 @@ -25,6 +25,9 @@ spec: postgresql: parameters: max_worker_processes: "60" +{% if dsc.sonarqube.postgresWalMaxSlotKeepSize is defined %} + max_slot_wal_keep_size: {{ dsc.sonarqube.postgresWalMaxSlotKeepSize }} +{% endif %} {% if dsc.sonarqube.cnpg.mode == "primary" %} pg_hba: # To access through TCP/IP you will need to get username