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 diff --git a/helmfile.d/snippets/defaults.yaml b/helmfile.d/snippets/defaults.yaml index a9270a0d0c..a9ec0ade4a 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 @@ -204,6 +193,9 @@ environments: registry: credentials: username: otomi-admin + database: + maxConnections: 28 + maxIdleConnections: 6 resources: core: requests: @@ -336,6 +328,10 @@ environments: keycloak: adminUsername: otomi-admin theme: otomi + database: + maxConnections: 28 + minConnections: 5 + initialConnections: 5 resources: keycloak: requests: @@ -1195,6 +1191,10 @@ environments: requests: cpu: "50m" memory: 48Mi + postgresqlParameters: + max_connections: "32" + shared_buffers: 64MB + work_mem: 2MB harbor: imageName: null size: 5Gi @@ -1220,6 +1220,10 @@ environments: requests: cpu: "50m" memory: 48Mi + postgresqlParameters: + max_connections: "32" + shared_buffers: 64MB + work_mem: 2MB gitea: imageName: null size: 5Gi @@ -1244,6 +1248,10 @@ environments: requests: cpu: "50m" memory: 48Mi + postgresqlParameters: + max_connections: "32" + shared_buffers: 64MB + work_mem: 2MB obj: provider: type: disabled 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 diff --git a/values-changes.yaml b/values-changes.yaml index 8cc3d8f67c..30ed6ad221 100644 --- a/values-changes.yaml +++ b/values-changes.yaml @@ -392,3 +392,7 @@ changes: - 'platformBackups.persistentVolumes' - 'teamConfig.{team}.backups' - '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 5cedf5693e..8ed2747091 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1686,15 +1686,15 @@ 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 + 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: @@ -1702,12 +1702,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: @@ -1779,8 +1773,15 @@ properties: required: - secret - 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: @@ -1903,6 +1904,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: @@ -3028,10 +3041,6 @@ properties: enabled: type: boolean default: false - resources: - $ref: '#/definitions/resources' - backupSidecarResources: - $ref: '#/definitions/resources' retentionPolicy: $ref: '#/definitions/backupRetentionPolicy' schedule: @@ -3046,10 +3055,6 @@ properties: enabled: type: boolean default: false - resources: - $ref: '#/definitions/resources' - backupSidecarResources: - $ref: '#/definitions/resources' retentionPolicy: $ref: '#/definitions/backupRetentionPolicy' schedule: @@ -3064,10 +3069,6 @@ properties: enabled: type: boolean default: false - resources: - $ref: '#/definitions/resources' - backupSidecarResources: - $ref: '#/definitions/resources' retentionPolicy: $ref: '#/definitions/backupRetentionPolicy' schedule: @@ -3166,6 +3167,13 @@ properties: type: string resources: $ref: '#/definitions/resources' + backupSidecarResources: + $ref: '#/definitions/resources' + postgresqlParameters: + type: object + additionalProperties: + type: string + default: {} replicas: type: integer default: 2 @@ -3188,6 +3196,13 @@ properties: type: string resources: $ref: '#/definitions/resources' + backupSidecarResources: + $ref: '#/definitions/resources' + postgresqlParameters: + type: object + additionalProperties: + type: string + default: {} replicas: type: integer default: 2 @@ -3210,6 +3225,13 @@ properties: type: string resources: $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 3bd7b47b84..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: @@ -66,4 +63,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/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" diff --git a/values/harbor/harbor-otomi-db.gotmpl b/values/harbor/harbor-otomi-db.gotmpl index 8db0b02208..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: @@ -63,4 +60,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/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 diff --git a/values/keycloak/keycloak-otomi-db.gotmpl b/values/keycloak/keycloak-otomi-db.gotmpl index 543ff267ed..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: @@ -66,4 +62,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 }} 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: