From 85f5738f2f0e6d68532e1518a3e2482caadffec5 Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Tue, 18 Nov 2025 17:26:14 +0100 Subject: [PATCH 01/10] feat: add database connection parameters to gitea values --- helmfile.d/snippets/defaults.yaml | 17 +++-------------- values-changes.yaml | 4 ++++ values-schema.yaml | 16 +++++++++------- values/gitea/gitea.gotmpl | 4 ++-- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/helmfile.d/snippets/defaults.yaml b/helmfile.d/snippets/defaults.yaml index eb28543ba7..e7974506e6 100644 --- a/helmfile.d/snippets/defaults.yaml +++ b/helmfile.d/snippets/defaults.yaml @@ -150,6 +150,9 @@ environments: _rawValues: {} networkPolicies: enabled: true + database: + maxConnections: 28 + maxIdleConnections: 6 resources: gitea: limits: @@ -158,20 +161,6 @@ environments: requests: cpu: 100m memory: 256Mi - memcached: - limits: - cpu: 250m - memory: 256Mi - requests: - cpu: 10m - memory: 128Mi - memcachedMetrics: - limits: - cpu: 200m - memory: 128M - requests: - cpu: 10m - memory: 16M init: limits: cpu: 400m diff --git a/values-changes.yaml b/values-changes.yaml index 72a8bac392..f9145112ec 100644 --- a/values-changes.yaml +++ b/values-changes.yaml @@ -388,3 +388,7 @@ changes: - 'e2e' - 'apps.falco' - 'apps.httpbin' + - 'apps.gitea.images' + - 'apps.gitea.resources.postgresql' + - 'apps.gitea.resources.memcached' + - 'apps.gitea.resources.memcachedMetrics' diff --git a/values-schema.yaml b/values-schema.yaml index b0e215dd34..2ee67e0fb7 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1711,15 +1711,17 @@ properties: description: This password was generated and cannot be changed without manual intervention. x-secret: '{{ randAlphaNum 20 }}' readOnly: true - image: + database: additionalProperties: false properties: - gitea: - $ref: '#/definitions/imageSimple' - postgresql: - $ref: '#/definitions/imageSimple' - memcached: - $ref: '#/definitions/imageSimple' + maxConnections: + type: number + default: 28 + description: Maximum amount of total connections of the application to the database server + maxIdleConnections: + type: number + default: 6 + description: Maximum amount of idle connections of the application to the database server resources: additionalProperties: false properties: diff --git a/values/gitea/gitea.gotmpl b/values/gitea/gitea.gotmpl index c83b4a6e6b..f7de83d4ca 100644 --- a/values/gitea/gitea.gotmpl +++ b/values/gitea/gitea.gotmpl @@ -128,9 +128,9 @@ gitea: name: gitea-db-secret key: password - name: GITEA__DATABASE__MAX_OPEN_CONNS - value: "32" + value: {{ $g.database.maxConnections | quote }} - name: GITEA__DATABASE__MAX_IDLE_CONNS - value: "6" + value: {{ $g.database.maxIdleConnections | quote }} - name: GITEA__CACHE__ADAPTER value: "redis" From 2f00c8556d6cd14fd59a7273cf1cd124cc09ff48 Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Tue, 18 Nov 2025 17:26:45 +0100 Subject: [PATCH 02/10] chore: added missing default value --- charts/otomi-db/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/otomi-db/values.yaml b/charts/otomi-db/values.yaml index a211fc2e95..18d51f6a95 100644 --- a/charts/otomi-db/values.yaml +++ b/charts/otomi-db/values.yaml @@ -3,6 +3,8 @@ labels: prometheus: system helm.sh/resource-policy: keep instances: 2 +postgresql: + parameters: {} storage: storageClass: "" size: 5Gi From 4315b5d3af3f34d5fd1e806da1c2e7606e440f39 Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Tue, 18 Nov 2025 17:28:47 +0100 Subject: [PATCH 03/10] chore: removed unused schema elements --- values-schema.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/values-schema.yaml b/values-schema.yaml index 2ee67e0fb7..25d060a602 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1729,12 +1729,6 @@ properties: $ref: '#/definitions/resources' init: $ref: '#/definitions/resources' - postgresql: - $ref: '#/definitions/resources' - memcached: - $ref: '#/definitions/resources' - memcachedMetrics: - $ref: '#/definitions/resources' networkPolicies: $ref: '#/definitions/appNetworkPolicyConfig' grafana: From d8f8b8f3899992e5193207d524adfa254525167c Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Wed, 19 Nov 2025 11:13:17 +0100 Subject: [PATCH 04/10] fix: location of backupSidecarResources --- values-schema.yaml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/values-schema.yaml b/values-schema.yaml index 25d060a602..bbfa250577 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -3073,10 +3073,6 @@ properties: enabled: type: boolean default: false - resources: - $ref: '#/definitions/resources' - backupSidecarResources: - $ref: '#/definitions/resources' retentionPolicy: $ref: '#/definitions/backupRetentionPolicy' schedule: @@ -3091,10 +3087,6 @@ properties: enabled: type: boolean default: false - resources: - $ref: '#/definitions/resources' - backupSidecarResources: - $ref: '#/definitions/resources' retentionPolicy: $ref: '#/definitions/backupRetentionPolicy' schedule: @@ -3109,10 +3101,6 @@ properties: enabled: type: boolean default: false - resources: - $ref: '#/definitions/resources' - backupSidecarResources: - $ref: '#/definitions/resources' retentionPolicy: $ref: '#/definitions/backupRetentionPolicy' schedule: @@ -3225,6 +3213,8 @@ properties: type: string resources: $ref: '#/definitions/resources' + backupSidecarResources: + $ref: '#/definitions/resources' replicas: type: integer default: 2 @@ -3247,6 +3237,8 @@ properties: type: string resources: $ref: '#/definitions/resources' + backupSidecarResources: + $ref: '#/definitions/resources' replicas: type: integer default: 2 @@ -3269,6 +3261,8 @@ properties: type: string resources: $ref: '#/definitions/resources' + backupSidecarResources: + $ref: '#/definitions/resources' replicas: type: integer default: 2 From 26baf273058c632659ce41b68dd2f9ffae8e5ab0 Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Wed, 19 Nov 2025 11:16:02 +0100 Subject: [PATCH 05/10] fix: make use of backupSidecarResources --- values/gitea/gitea-otomi-db.gotmpl | 3 ++- values/harbor/harbor-otomi-db.gotmpl | 3 ++- values/keycloak/keycloak-otomi-db.gotmpl | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/values/gitea/gitea-otomi-db.gotmpl b/values/gitea/gitea-otomi-db.gotmpl index 3bd7b47b84..65242c5665 100644 --- a/values/gitea/gitea-otomi-db.gotmpl +++ b/values/gitea/gitea-otomi-db.gotmpl @@ -66,4 +66,5 @@ clusterSpec: externalClusters: {{ toYaml $gdb.externalClusters | nindent 4 }} {{- end }} -resources: {{- toYaml $gdb.resources | nindent 2 }} +resources: {{ toYaml $gdb.resources | nindent 2 }} +backupSidecarResources: {{ toYaml $gdb.backupSidecarResources | nindent 2 }} diff --git a/values/harbor/harbor-otomi-db.gotmpl b/values/harbor/harbor-otomi-db.gotmpl index 8db0b02208..2bf3b3042f 100644 --- a/values/harbor/harbor-otomi-db.gotmpl +++ b/values/harbor/harbor-otomi-db.gotmpl @@ -63,4 +63,5 @@ clusterSpec: externalClusters: {{ toYaml . | nindent 4 }} {{- end }} -resources: {{- toYaml $hdb.resources | nindent 2 }} +resources: {{ toYaml $hdb.resources | nindent 2 }} +backupSidecarResources: {{ toYaml $hdb.backupSidecarResources | nindent 2 }} diff --git a/values/keycloak/keycloak-otomi-db.gotmpl b/values/keycloak/keycloak-otomi-db.gotmpl index 543ff267ed..e84bbd798d 100644 --- a/values/keycloak/keycloak-otomi-db.gotmpl +++ b/values/keycloak/keycloak-otomi-db.gotmpl @@ -66,4 +66,5 @@ clusterSpec: externalClusters: {{ toYaml . | nindent 4 }} {{- end }} -resources: {{- toYaml $kdb.resources | nindent 2 }} +resources: {{ toYaml $kdb.resources | nindent 2 }} +backupSidecarResources: {{ toYaml $kdb.backupSidecarResources | nindent 2 }} From d480d57e99b67e51fd4c50cee52fa86cc2ab3892 Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Wed, 19 Nov 2025 11:22:01 +0100 Subject: [PATCH 06/10] feat: added postgresqlParameters to values --- helmfile.d/snippets/defaults.yaml | 12 ++++++++++++ values-schema.yaml | 15 +++++++++++++++ values/gitea/gitea-otomi-db.gotmpl | 5 +---- values/harbor/harbor-otomi-db.gotmpl | 5 +---- values/keycloak/keycloak-otomi-db.gotmpl | 6 +----- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/helmfile.d/snippets/defaults.yaml b/helmfile.d/snippets/defaults.yaml index e7974506e6..a0c71ab270 100644 --- a/helmfile.d/snippets/defaults.yaml +++ b/helmfile.d/snippets/defaults.yaml @@ -1197,6 +1197,10 @@ environments: requests: cpu: "50m" memory: 48Mi + postgresqlParameters: + max_connections: "32" + shared_buffers: 64MB + work_mem: 2MB harbor: imageName: null size: 5Gi @@ -1222,6 +1226,10 @@ environments: requests: cpu: "50m" memory: 48Mi + postgresqlParameters: + max_connections: "32" + shared_buffers: 64MB + work_mem: 2MB gitea: imageName: null size: 5Gi @@ -1246,6 +1254,10 @@ environments: requests: cpu: "50m" memory: 48Mi + postgresqlParameters: + max_connections: "32" + shared_buffers: 64MB + work_mem: 2MB obj: provider: type: disabled diff --git a/values-schema.yaml b/values-schema.yaml index bbfa250577..21da3d8bfb 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -3215,6 +3215,11 @@ properties: $ref: '#/definitions/resources' backupSidecarResources: $ref: '#/definitions/resources' + postgresqlParameters: + type: object + additionalProperties: + type: string + default: {} replicas: type: integer default: 2 @@ -3239,6 +3244,11 @@ properties: $ref: '#/definitions/resources' backupSidecarResources: $ref: '#/definitions/resources' + postgresqlParameters: + type: object + additionalProperties: + type: string + default: {} replicas: type: integer default: 2 @@ -3263,6 +3273,11 @@ properties: $ref: '#/definitions/resources' backupSidecarResources: $ref: '#/definitions/resources' + postgresqlParameters: + type: object + additionalProperties: + type: string + default: {} replicas: type: integer default: 2 diff --git a/values/gitea/gitea-otomi-db.gotmpl b/values/gitea/gitea-otomi-db.gotmpl index 65242c5665..16d0909dc6 100644 --- a/values/gitea/gitea-otomi-db.gotmpl +++ b/values/gitea/gitea-otomi-db.gotmpl @@ -27,10 +27,7 @@ imageName: ghcr.io/{{ $cnpg.pgDefaultPlatformImage }} {{- end }} postgresql: - parameters: - max_connections: "32" - shared_buffers: 64MB - work_mem: 2MB + parameters: {{ toYaml $gdb.postgresqlParameters | nindent 4 }} {{- if and $b.enabled (eq $obj.type "minioLocal" "linode") }} backup: diff --git a/values/harbor/harbor-otomi-db.gotmpl b/values/harbor/harbor-otomi-db.gotmpl index 2bf3b3042f..5c74802108 100644 --- a/values/harbor/harbor-otomi-db.gotmpl +++ b/values/harbor/harbor-otomi-db.gotmpl @@ -26,10 +26,7 @@ imageName: ghcr.io/{{ $cnpg.pgDefaultPlatformImage }} {{- end }} postgresql: - parameters: - max_connections: "32" - shared_buffers: 64MB - work_mem: 2MB + parameters: {{ toYaml $hdb.postgresqlParameters | nindent 4 }} {{- if and $b.enabled (eq $obj.type "minioLocal" "linode") }} backup: diff --git a/values/keycloak/keycloak-otomi-db.gotmpl b/values/keycloak/keycloak-otomi-db.gotmpl index e84bbd798d..9c83c4d1db 100644 --- a/values/keycloak/keycloak-otomi-db.gotmpl +++ b/values/keycloak/keycloak-otomi-db.gotmpl @@ -27,12 +27,8 @@ imageName: {{ $v.otomi.linodeLkeImageRepository }}/ghcr/{{ $cnpg.pgDefaultPlatfo imageName: ghcr.io/{{ $cnpg.pgDefaultPlatformImage }} {{- end }} - postgresql: - parameters: - max_connections: "32" - shared_buffers: 64MB - work_mem: 2MB + parameters: {{ toYaml $kdb.postgresqlParameters | nindent 4 }} {{- if and $b.enabled (eq $obj.type "minioLocal" "linode") }} backup: From 0e1c636c571c07ece336d92ee5e2f5f73e0fd74b Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Wed, 19 Nov 2025 12:15:28 +0100 Subject: [PATCH 07/10] feat: added connection parameters for Harbor --- helmfile.d/snippets/defaults.yaml | 3 +++ values-schema.yaml | 11 +++++++++-- values/harbor/harbor.gotmpl | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/helmfile.d/snippets/defaults.yaml b/helmfile.d/snippets/defaults.yaml index a0c71ab270..6feef7fe0f 100644 --- a/helmfile.d/snippets/defaults.yaml +++ b/helmfile.d/snippets/defaults.yaml @@ -193,6 +193,9 @@ environments: registry: credentials: username: otomi-admin + database: + maxConnections: 28 + maxIdleConnections: 6 resources: core: requests: diff --git a/values-schema.yaml b/values-schema.yaml index 21da3d8bfb..3a9fda8974 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1716,11 +1716,9 @@ properties: properties: maxConnections: type: number - default: 28 description: Maximum amount of total connections of the application to the database server maxIdleConnections: type: number - default: 6 description: Maximum amount of idle connections of the application to the database server resources: additionalProperties: false @@ -1802,6 +1800,15 @@ properties: - credentials image: $ref: '#/definitions/imageSimple' + database: + additionalProperties: false + properties: + maxConnections: + type: number + description: Maximum amount of total connections of the application to the database server + maxIdleConnections: + type: number + description: Maximum amount of idle connections of the application to the database server resources: additionalProperties: false properties: diff --git a/values/harbor/harbor.gotmpl b/values/harbor/harbor.gotmpl index 1246c41185..2ee9358e1d 100644 --- a/values/harbor/harbor.gotmpl +++ b/values/harbor/harbor.gotmpl @@ -35,8 +35,8 @@ core: xsrfKey: {{ $h | get "core.xsrfKey" nil }} database: - maxOpenConns: 32 - maxIdleConns: 6 + maxOpenConns: {{ $h.database.maxConnections }} + maxIdleConns: {{ $h.database.maxIdleConnections }} type: external external: # erase default password value from the Harbor Helm chart From ec997bc34047daa72eefb6403465f4c39d5a4599 Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Wed, 19 Nov 2025 12:15:44 +0100 Subject: [PATCH 08/10] chore: removed unused value from schema --- values-schema.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/values-schema.yaml b/values-schema.yaml index 3a9fda8974..fa4a204724 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1798,8 +1798,6 @@ properties: required: - secret - credentials - image: - $ref: '#/definitions/imageSimple' database: additionalProperties: false properties: From f6e7f97f7a7ddf1f29301c3c133189e02745ff6f Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Wed, 19 Nov 2025 14:21:39 +0100 Subject: [PATCH 09/10] feat: added connection parameters for Keycloak --- helmfile.d/snippets/defaults.yaml | 4 ++++ values-schema.yaml | 12 ++++++++++++ values/keycloak/keycloak.gotmpl | 6 +++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/helmfile.d/snippets/defaults.yaml b/helmfile.d/snippets/defaults.yaml index 6feef7fe0f..3552a8fc14 100644 --- a/helmfile.d/snippets/defaults.yaml +++ b/helmfile.d/snippets/defaults.yaml @@ -328,6 +328,10 @@ environments: keycloak: adminUsername: otomi-admin theme: otomi + database: + maxConnections: 28 + minConnections: 5 + initialConnections: 5 resources: keycloak: requests: diff --git a/values-schema.yaml b/values-schema.yaml index fa4a204724..5c5ed227b4 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1929,6 +1929,18 @@ properties: $ref: '#/definitions/imageSimple' postgresql: $ref: '#/definitions/imageSimple' + database: + additionalProperties: false + properties: + maxConnections: + type: number + description: Maximum amount of total connections of the application to the database server + minConnections: + type: number + description: Minimum amount of connections of the application to the database server + initialConnections: + type: number + description: Initial amount of connections of the application to the database server on startup resources: additionalProperties: false properties: diff --git a/values/keycloak/keycloak.gotmpl b/values/keycloak/keycloak.gotmpl index 9ed2a14b20..c21e262f32 100644 --- a/values/keycloak/keycloak.gotmpl +++ b/values/keycloak/keycloak.gotmpl @@ -85,11 +85,11 @@ extraEnv: | - name: KC_HOSTNAME value: keycloak.{{ $v.cluster.domainSuffix }} - name: KC_DB_POOL_INITIAL_SIZE - value: "5" + value: {{ $k.database.initialConnections | quote }} - name: KC_DB_POOL_MIN_SIZE - value: "5" + value: {{ $k.database.minConnections | quote }} - name: KC_DB_POOL_MAX_SIZE - value: "32" + value: {{ $k.database.maxConnections | quote }} - name: KC_BOOTSTRAP_ADMIN_USERNAME valueFrom: secretKeyRef: From 1ae34df49c3f9c198fb4590e5a51825de92aa0fb Mon Sep 17 00:00:00 2001 From: Matthias Erll Date: Wed, 19 Nov 2025 14:33:31 +0100 Subject: [PATCH 10/10] chore: migrated values on test fixture --- tests/fixtures/env/apps/gitea.yaml | 16 +--------------- .../demo/workloadValues/wd.managed.managed.yaml | 0 .../env/teams/demo/workloadValues/wd.yaml | 2 +- .../demo/workloadValues/wd1.managed.managed.yaml | 0 .../env/teams/demo/workloadValues/wd1.yaml | 2 +- .../demo/workloadValues/wd2.managed.managed.yaml | 0 .../env/teams/demo/workloadValues/wd2.yaml | 2 +- .../demo/workloadValues/wd3.managed.managed.yaml | 0 .../env/teams/demo/workloadValues/wd3.yaml | 2 +- 9 files changed, 5 insertions(+), 19 deletions(-) create mode 100644 tests/fixtures/env/teams/demo/workloadValues/wd.managed.managed.yaml create mode 100644 tests/fixtures/env/teams/demo/workloadValues/wd1.managed.managed.yaml create mode 100644 tests/fixtures/env/teams/demo/workloadValues/wd2.managed.managed.yaml create mode 100644 tests/fixtures/env/teams/demo/workloadValues/wd3.managed.managed.yaml diff --git a/tests/fixtures/env/apps/gitea.yaml b/tests/fixtures/env/apps/gitea.yaml index af753ba56f..c3adf6e541 100644 --- a/tests/fixtures/env/apps/gitea.yaml +++ b/tests/fixtures/env/apps/gitea.yaml @@ -9,7 +9,7 @@ spec: resources: gitea: limits: - cpu: '1' + cpu: "1" memory: 1Gi requests: cpu: 100m @@ -21,17 +21,3 @@ spec: requests: cpu: 100m memory: 128Mi - memcached: - limits: - cpu: 250m - memory: 256Mi - requests: - cpu: 10m - memory: 128Mi - memcachedMetrics: - limits: - cpu: 200m - memory: 128M - requests: - cpu: 10m - memory: 16M diff --git a/tests/fixtures/env/teams/demo/workloadValues/wd.managed.managed.yaml b/tests/fixtures/env/teams/demo/workloadValues/wd.managed.managed.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/fixtures/env/teams/demo/workloadValues/wd.yaml b/tests/fixtures/env/teams/demo/workloadValues/wd.yaml index 26a745ddb6..9e26dfeeb6 100644 --- a/tests/fixtures/env/teams/demo/workloadValues/wd.yaml +++ b/tests/fixtures/env/teams/demo/workloadValues/wd.yaml @@ -1 +1 @@ -a: b +{} \ No newline at end of file diff --git a/tests/fixtures/env/teams/demo/workloadValues/wd1.managed.managed.yaml b/tests/fixtures/env/teams/demo/workloadValues/wd1.managed.managed.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/fixtures/env/teams/demo/workloadValues/wd1.yaml b/tests/fixtures/env/teams/demo/workloadValues/wd1.yaml index 26a745ddb6..9e26dfeeb6 100644 --- a/tests/fixtures/env/teams/demo/workloadValues/wd1.yaml +++ b/tests/fixtures/env/teams/demo/workloadValues/wd1.yaml @@ -1 +1 @@ -a: b +{} \ No newline at end of file diff --git a/tests/fixtures/env/teams/demo/workloadValues/wd2.managed.managed.yaml b/tests/fixtures/env/teams/demo/workloadValues/wd2.managed.managed.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/fixtures/env/teams/demo/workloadValues/wd2.yaml b/tests/fixtures/env/teams/demo/workloadValues/wd2.yaml index 26a745ddb6..9e26dfeeb6 100644 --- a/tests/fixtures/env/teams/demo/workloadValues/wd2.yaml +++ b/tests/fixtures/env/teams/demo/workloadValues/wd2.yaml @@ -1 +1 @@ -a: b +{} \ No newline at end of file diff --git a/tests/fixtures/env/teams/demo/workloadValues/wd3.managed.managed.yaml b/tests/fixtures/env/teams/demo/workloadValues/wd3.managed.managed.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/fixtures/env/teams/demo/workloadValues/wd3.yaml b/tests/fixtures/env/teams/demo/workloadValues/wd3.yaml index 26a745ddb6..9e26dfeeb6 100644 --- a/tests/fixtures/env/teams/demo/workloadValues/wd3.yaml +++ b/tests/fixtures/env/teams/demo/workloadValues/wd3.yaml @@ -1 +1 @@ -a: b +{} \ No newline at end of file