mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 05:25:14 +09:00
fix(seaweedfs-db): make db resources configurable
values.yaml declared an unused Resources typedef while templates/database.yaml hardcoded cpu/memory limits and requests. The wrapper chart at packages/extra/seaweedfs/templates/seaweedfs-db.yaml already passes db.resources through cozy-lib.resources.defaultingSanitize into the sub-chart values, so the user-facing db.resources and db.resourcesPreset on the outer chart silently dropped on the way in. Drop the unused typedef, accept .Values.db.resources as a free-form object (the wrapper already sanitizes it into the K8s nested limits/requests shape that CNPG Cluster expects), and wire it through to the Cluster manifest. Defaults are preserved verbatim so helm template output is byte-identical for a no-override install. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
4 files changed
+31
-16
No files matched your search
@@ -4,10 +4,11 @@
|
||||
|
||||
### Database parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | ------------------------------------ | ---------- | ------ |
|
||||
| `db` | Database configuration. | `object` | `{}` |
|
||||
| `db.replicas` | Number of database replicas. | `int` | `2` |
|
||||
| `db.size` | Persistent Volume size. | `quantity` | `10Gi` |
|
||||
| `db.storageClass` | StorageClass used to store the data. | `string` | `""` |
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | ----------------------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------- |
|
||||
| `db` | Database configuration. | `object` | `{}` |
|
||||
| `db.replicas` | Number of database replicas. | `int` | `2` |
|
||||
| `db.size` | Persistent Volume size. | `quantity` | `10Gi` |
|
||||
| `db.storageClass` | StorageClass used to store the data. | `string` | `""` |
|
||||
| `db.resources` | Kubernetes resource requests and limits, passed verbatim to the CNPG Cluster. | `object` | `{"limits":{"cpu":"1","memory":"2048Mi"},"requests":{"cpu":"100m","memory":"512Mi"}}` |
|
||||
|
||||
@@ -17,12 +17,7 @@ spec:
|
||||
monitoring:
|
||||
enablePodMonitor: true
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 2048Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
{{- toYaml .Values.db.resources | nindent 4 }}
|
||||
inheritedMetadata:
|
||||
labels:
|
||||
policy.cozystack.io/allow-to-apiserver: "true"
|
||||
@@ -12,6 +12,21 @@
|
||||
"type": "integer",
|
||||
"default": 2
|
||||
},
|
||||
"resources": {
|
||||
"description": "Kubernetes resource requests and limits, passed verbatim to the CNPG Cluster.",
|
||||
"type": "object",
|
||||
"default": {
|
||||
"limits": {
|
||||
"cpu": "1",
|
||||
"memory": "2048Mi"
|
||||
},
|
||||
"requests": {
|
||||
"cpu": "100m",
|
||||
"memory": "512Mi"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"size": {
|
||||
"description": "Persistent Volume size.",
|
||||
"default": "10Gi",
|
||||
|
||||
@@ -2,17 +2,21 @@
|
||||
## @section Database parameters
|
||||
##
|
||||
|
||||
## @typedef {struct} Resources - Resource configuration.
|
||||
## @field {quantity} [cpu] - Number of CPU cores allocated.
|
||||
## @field {quantity} [memory] - Amount of memory allocated.
|
||||
|
||||
## @typedef {struct} DB - Database configuration.
|
||||
## @field {int} [replicas] - Number of database replicas.
|
||||
## @field {quantity} [size] - Persistent Volume size.
|
||||
## @field {string} [storageClass] - StorageClass used to store the data.
|
||||
## @field {object} [resources] - Kubernetes resource requests and limits, passed verbatim to the CNPG Cluster.
|
||||
|
||||
## @param {DB} db - Database configuration.
|
||||
db:
|
||||
replicas: 2
|
||||
size: 10Gi
|
||||
storageClass: ""
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 2048Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
Reference in new issue
Block a user