diff --git a/forgejoRunner/README.md b/forgejoRunner/README.md index 831b717..8fcf486 100644 --- a/forgejoRunner/README.md +++ b/forgejoRunner/README.md @@ -81,3 +81,11 @@ Here is are examples of Forgejo action steps: | `forgejoInstanceUrl` | Forgejo instance url. | `https://codeberg.org` | | `secretRef` | The secret reference for the Forgejo Runner | `forgejo-runner` | | `storageClassName` | Set the storage class | `""` | + +### Resources requests and limits + +| Name | Description | Value | +| --------------------------- | -------------------------------- | ------- | +| `resources.requests.memory` | Memory request for the container | `500Mi` | +| `resources.requests.cpu` | CPU request for the container | `100m` | +| `resources.limits.memory` | Memory limit for the container | `1Gi` | diff --git a/forgejoRunner/templates/deploy.yaml b/forgejoRunner/templates/deploy.yaml index 56c3a62..01ed87b 100644 --- a/forgejoRunner/templates/deploy.yaml +++ b/forgejoRunner/templates/deploy.yaml @@ -47,12 +47,7 @@ spec: - name: runner-config mountPath: /config resources: - limits: - cpu: "1" - memory: "1024Mi" - requests: - cpu: "50m" - memory: "32Mi" + {{- toYaml .Values.resources | nindent 10 }} containers: - name: runner image: {{ .Values.image }} @@ -77,12 +72,7 @@ spec: - name: runner-config mountPath: /config resources: - limits: - cpu: "1" - memory: "1024Mi" - requests: - cpu: "50m" - memory: "32Mi" + {{- toYaml .Values.resources | nindent 10 }} - name: daemon image: docker:27.5.1-dind env: @@ -96,12 +86,7 @@ spec: - name: docker-data mountPath: /var/lib/docker resources: - limits: - cpu: "2" - memory: "4096Mi" - requests: - cpu: "50m" - memory: "32Mi" + {{- toYaml .Values.resources | nindent 10 }} volumes: - name: docker-certs emptyDir: {} diff --git a/forgejoRunner/values.yaml b/forgejoRunner/values.yaml index 8bf59f3..2136e21 100644 --- a/forgejoRunner/values.yaml +++ b/forgejoRunner/values.yaml @@ -9,3 +9,13 @@ forgejoInstanceUrl: https://codeberg.org secretRef: forgejo-runner ## @param storageClassName Set the storage class storageClassName: "" +## @section Resources requests and limits +resources: + ## @param resources.requests.memory Memory request for the container + requests: + memory: "500Mi" + ## @param resources.requests.cpu CPU request for the container + cpu: "100m" + limits: + ## @param resources.limits.memory Memory limit for the container + memory: "1Gi" diff --git a/hugo/README.md b/hugo/README.md index d2bc6b1..6a2e08e 100644 --- a/hugo/README.md +++ b/hugo/README.md @@ -20,3 +20,11 @@ This Helm chart deploys a Hugo site. | ----------------- | -------------------------- | -------- | | `image` | The image for Hugo | `""` | | `imagePullPolicy` | Pull policy for Hugo image | `Always` | + +### Resources requests and limits + +| Name | Description | Value | +| --------------------------- | -------------------------------- | ------- | +| `resources.requests.memory` | Memory request for the container | `500Mi` | +| `resources.requests.cpu` | CPU request for the container | `100m` | +| `resources.limits.memory` | Memory limit for the container | `1Gi` | diff --git a/hugo/templates/deploy.yaml b/hugo/templates/deploy.yaml index cc3b4ae..01f06be 100644 --- a/hugo/templates/deploy.yaml +++ b/hugo/templates/deploy.yaml @@ -19,3 +19,5 @@ spec: imagePullPolicy: {{ .Values.imagePullPolicy }} ports: - containerPort: 80 + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/hugo/values.yaml b/hugo/values.yaml index f7a2b5f..ad3715d 100644 --- a/hugo/values.yaml +++ b/hugo/values.yaml @@ -16,3 +16,13 @@ ingress: image: "" ## @param imagePullPolicy Pull policy for Hugo image imagePullPolicy: Always +## @section Resources requests and limits +resources: + ## @param resources.requests.memory Memory request for the container + requests: + memory: "500Mi" + ## @param resources.requests.cpu CPU request for the container + cpu: "100m" + limits: + ## @param resources.limits.memory Memory limit for the container + memory: "1Gi" diff --git a/nextcloud/README.md b/nextcloud/README.md index ccf2e69..f49ade2 100644 --- a/nextcloud/README.md +++ b/nextcloud/README.md @@ -65,6 +65,9 @@ kubectl create secret generic s3-credentials \ | `nextcloud.externalDatabase.existingSecret.secretName` | Name of the existing Kubernetes secret | `nextcloud-postgresql-app` | | `nextcloud.externalDatabase.existingSecret.usernameKey` | Key in the secret containing the database username | `username` | | `nextcloud.externalDatabase.existingSecret.passwordKey` | Key in the secret containing the database password | `password` | +| `nextcloud.resources.requests.memory` | Memory request for the container | `1Gi` | +| `nextcloud.resources.requests.cpu` | CPU request for the container | `250m` | +| `nextcloud.resources.limits.memory` | Memory limit for the container | `2Gi` | ### Redis parameters diff --git a/nextcloud/values.yaml b/nextcloud/values.yaml index 1098c48..7581022 100644 --- a/nextcloud/values.yaml +++ b/nextcloud/values.yaml @@ -66,6 +66,15 @@ nextcloud: usernameKey: username ## @param nextcloud.externalDatabase.existingSecret.passwordKey Key in the secret containing the database password passwordKey: password + resources: + ## @param nextcloud.resources.requests.memory Memory request for the container + requests: + memory: "1Gi" + ## @param nextcloud.resources.requests.cpu CPU request for the container + cpu: "250m" + limits: + ## @param nextcloud.resources.limits.memory Memory limit for the container + memory: "2Gi" ## @section Redis parameters redis: diff --git a/odoo/README.md b/odoo/README.md index fab53c0..3c05564 100644 --- a/odoo/README.md +++ b/odoo/README.md @@ -95,6 +95,14 @@ kubectl create job --from=cronjob/-staging-reset -staging-rese | `secretRef` | The secret reference for Odoo | `odoo-creds` | | `storageClassName` | Set the storage class | `""` | +### Resources requests and limits + +| Name | Description | Value | +| --------------------------- | -------------------------------- | ------ | +| `resources.requests.memory` | Memory request for the container | `1Gi` | +| `resources.requests.cpu` | CPU request for the container | `250m` | +| `resources.limits.memory` | Memory limit for the container | `2Gi` | + ### K8up parameters | Name | Description | Value | diff --git a/odoo/templates/deploy-staging.yaml b/odoo/templates/deploy-staging.yaml index 983dd65..05ae676 100644 --- a/odoo/templates/deploy-staging.yaml +++ b/odoo/templates/deploy-staging.yaml @@ -102,6 +102,8 @@ spec: securityContext: runAsUser: 0 runAsGroup: 0 + resources: + {{- toYaml .Values.resources | nindent 12 }} containers: - name: odoo image: {{ or .Values.staging.image .Values.image }} @@ -184,6 +186,8 @@ spec: readOnly: true mountPath: "/mnt/{{ .Values.vshnPostgres.secretRef }}" {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} volumes: - name: odoo-staging persistentVolumeClaim: diff --git a/odoo/templates/deploy.yaml b/odoo/templates/deploy.yaml index 997ac71..b780344 100644 --- a/odoo/templates/deploy.yaml +++ b/odoo/templates/deploy.yaml @@ -104,6 +104,8 @@ spec: readOnly: true mountPath: "/mnt/{{ .Values.vshnPostgres.secretRef }}" {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} containers: - name: odoo image: {{ .Values.image }} @@ -184,6 +186,8 @@ spec: readOnly: true mountPath: "/mnt/{{ .Values.vshnPostgres.secretRef }}" {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} volumes: - name: odoo-main persistentVolumeClaim: diff --git a/odoo/values.yaml b/odoo/values.yaml index 4508943..e32c296 100644 --- a/odoo/values.yaml +++ b/odoo/values.yaml @@ -91,6 +91,16 @@ workers: 5 secretRef: odoo-creds ## @param storageClassName Set the storage class storageClassName: "" +## @section Resources requests and limits +resources: + ## @param resources.requests.memory Memory request for the container + requests: + memory: "1Gi" + ## @param resources.requests.cpu CPU request for the container + cpu: "250m" + limits: + ## @param resources.limits.memory Memory limit for the container + memory: "2Gi" ## @section K8up parameters k8up: diff --git a/postgres/README.md b/postgres/README.md index c9af0b8..bfd0ecc 100644 --- a/postgres/README.md +++ b/postgres/README.md @@ -17,3 +17,11 @@ This chart deploys a Postgres container and stores the credentials in a secret. | `secretRef` | The secret reference for Postgres | `postgres` | | `userPasswordKey` | The user password key for Postgres | `password` | | `storageClassName` | Set the storage class | `""` | + +### Resources requests and limits + +| Name | Description | Value | +| --------------------------- | -------------------------------- | ------- | +| `resources.requests.memory` | Memory request for the container | `500Mi` | +| `resources.requests.cpu` | CPU request for the container | `100m` | +| `resources.limits.memory` | Memory limit for the container | `1Gi` | diff --git a/postgres/templates/deploy.yaml b/postgres/templates/deploy.yaml index d3f8c83..02c5ae1 100644 --- a/postgres/templates/deploy.yaml +++ b/postgres/templates/deploy.yaml @@ -36,6 +36,8 @@ spec: secretKeyRef: name: {{ .Values.secretRef }} key: {{ .Values.userPasswordKey }} + resources: + {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - mountPath: /var/lib/postgresql/data/ name: postgres diff --git a/postgres/values.yaml b/postgres/values.yaml index fbe37e5..9ad1ed6 100644 --- a/postgres/values.yaml +++ b/postgres/values.yaml @@ -17,3 +17,13 @@ secretRef: postgres userPasswordKey: "password" ## @param storageClassName Set the storage class storageClassName: "" +## @section Resources requests and limits +resources: + ## @param resources.requests.memory Memory request for the container + requests: + memory: "500Mi" + ## @param resources.requests.cpu CPU request for the container + cpu: "100m" + limits: + ## @param resources.limits.memory Memory limit for the container + memory: "1Gi" diff --git a/prometheusAgent/README.md b/prometheusAgent/README.md index ef0a146..29a672f 100644 --- a/prometheusAgent/README.md +++ b/prometheusAgent/README.md @@ -33,10 +33,9 @@ kubectl create secret generic prometheus-remote-write-credentials \ | Name | Description | Value | | --------------------------- | -------------------------------- | ------- | -| `resources.requests.memory` | Memory request for the container | `64Mi` | -| `resources.requests.cpu` | CPU request for the container | `250m` | -| `resources.limits.memory` | Memory limit for the container | `128Mi` | -| `resources.limits.cpu` | CPU limit for the container | `500m` | +| `resources.requests.memory` | Memory request for the container | `500Mi` | +| `resources.requests.cpu` | CPU request for the container | `100m` | +| `resources.limits.memory` | Memory limit for the container | `1Gi` | ### Kube-state-metrics configuration diff --git a/prometheusAgent/values.yaml b/prometheusAgent/values.yaml index 6f477c9..f9b798e 100644 --- a/prometheusAgent/values.yaml +++ b/prometheusAgent/values.yaml @@ -94,14 +94,12 @@ scrapeConfigs: | resources: requests: ## @param resources.requests.memory Memory request for the container - memory: "64Mi" + memory: "500Mi" ## @param resources.requests.cpu CPU request for the container - cpu: "250m" + cpu: "100m" limits: ## @param resources.limits.memory Memory limit for the container - memory: "128Mi" - ## @param resources.limits.cpu CPU limit for the container - cpu: "500m" + memory: "1Gi" ## @section Kube-state-metrics configuration ## @param kube-state-metrics.enabled Enable kube-state-metrics as sub-chart diff --git a/prompts/08_add-memory-limit-to-all-charts.md b/prompts/08_add-memory-limit-to-all-charts.md new file mode 100644 index 0000000..3a91514 --- /dev/null +++ b/prompts/08_add-memory-limit-to-all-charts.md @@ -0,0 +1,63 @@ +--- +title: "Add memory limit to all charts" +state: completed +model: infomaniak/moonshotai/Kimi-K2.6 +input_tokens: +--- + +# Run 08 + +Note: @Clanker refers to the "ai agent" (you) who is working on this task. + +@Clanker when working on this task, make sure to: + +- Read context and task section first +- Prepare a list of todos +- Update the todo list while working on the task + +## Context + +@Clanker Read the `AGENTS.md` and `README.md` to get an understanding of the project. + +## Task + +Set this limit for all charts: + +```yml +resources: + requests: + memory: "500Mi" + cpu: "100m" + limits: + memory: "1Gi" +``` + +And for odoo and nextcloud use this: + +```yaml +resources: + requests: + memory: 1Gi + cpu: 250m + limits: + memory: 2Gi +``` + +## Worklog + +Set resource limits for all charts with deployments: + +- **odoo**, **nextcloud**: requests `memory: 1Gi`, `cpu: 250m`; limits `memory: 2Gi` +- **hugo**, **vuepress**, **taskfileBuild**, **postgres**, **prometheusAgent**, **forgejoRunner**, **vshnPostgres**: requests `memory: 500Mi`, `cpu: 100m`; limits `memory: 1Gi` + +Changes made: +1. Added `resources` block to `values.yaml` for all relevant charts. +2. Updated deployment templates to reference `{{- toYaml .Values.resources | nindent 12 }}` (or appropriate indentation) where missing. +3. Replaced hardcoded resource limits in **forgejoRunner** and **vshnPostgres** templates with values references. +4. For **nextcloud**, passed resources to the upstream `nextcloud` subchart via `nextcloud.resources`. +5. Updated **prometheusAgent** values to the new default limits. +6. Ran `./task lint` and `./task docs` successfully to validate formatting and regenerate READMEs. + +Skipped charts without container workloads: `clusterIssuer`, `deploymentUpdater`. + +@Clanker Set frontmatter state to completed and update info about model and token usage. diff --git a/taskfileBuild/README.md b/taskfileBuild/README.md index 1027fba..bdbedad 100644 --- a/taskfileBuild/README.md +++ b/taskfileBuild/README.md @@ -25,3 +25,11 @@ This Helm chart deploys a taskfile.build container. | `caddyRoot` | Static site path relative to repo root. | `""` | | `additionalEnvs` | Additional environment variables to set | `{}` | | `storageClassName` | Set the storage class | `""` | + +### Resources requests and limits + +| Name | Description | Value | +| --------------------------- | -------------------------------- | ------- | +| `resources.requests.memory` | Memory request for the container | `500Mi` | +| `resources.requests.cpu` | CPU request for the container | `100m` | +| `resources.limits.memory` | Memory limit for the container | `1Gi` | diff --git a/taskfileBuild/templates/deploy.yaml b/taskfileBuild/templates/deploy.yaml index 9929ceb..37b325a 100644 --- a/taskfileBuild/templates/deploy.yaml +++ b/taskfileBuild/templates/deploy.yaml @@ -32,6 +32,8 @@ spec: {{- end }} ports: - containerPort: 80 + resources: + {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - name: app-data mountPath: /app diff --git a/taskfileBuild/values.yaml b/taskfileBuild/values.yaml index 4d387a5..a15506d 100644 --- a/taskfileBuild/values.yaml +++ b/taskfileBuild/values.yaml @@ -25,4 +25,14 @@ caddyRoot: "" ## @param additionalEnvs Additional environment variables to set additionalEnvs: {} ## @param storageClassName Set the storage class -storageClassName: "" \ No newline at end of file +storageClassName: "" +## @section Resources requests and limits +resources: + ## @param resources.requests.memory Memory request for the container + requests: + memory: "500Mi" + ## @param resources.requests.cpu CPU request for the container + cpu: "100m" + limits: + ## @param resources.limits.memory Memory limit for the container + memory: "1Gi" \ No newline at end of file diff --git a/vshnPostgres/README.md b/vshnPostgres/README.md index 1b5c1ac..90652de 100644 --- a/vshnPostgres/README.md +++ b/vshnPostgres/README.md @@ -11,3 +11,11 @@ This chart deploys a VSHN Postgres service. | `enabled` | Enable or disable vshnPostgres | `false` | | `secretRef` | The secret reference for vshnPostgres | `postgres-creds` | | `client.enabled` | Enable or disable the vshnPostgres client | `false` | + +### Resources requests and limits + +| Name | Description | Value | +| --------------------------- | -------------------------------- | ------- | +| `resources.requests.memory` | Memory request for the container | `500Mi` | +| `resources.requests.cpu` | CPU request for the container | `100m` | +| `resources.limits.memory` | Memory limit for the container | `1Gi` | diff --git a/vshnPostgres/templates/postgres-deploy.yaml b/vshnPostgres/templates/postgres-deploy.yaml index 77ea774..e1a5f44 100644 --- a/vshnPostgres/templates/postgres-deploy.yaml +++ b/vshnPostgres/templates/postgres-deploy.yaml @@ -43,9 +43,7 @@ spec: - name: postgres-client image: postgres:16 resources: - limits: - memory: "128Mi" - cpu: "500m" + {{- toYaml .Values.resources | nindent 6 }} command: - /bin/sh - -c diff --git a/vshnPostgres/values.yaml b/vshnPostgres/values.yaml index ded62d3..219732f 100644 --- a/vshnPostgres/values.yaml +++ b/vshnPostgres/values.yaml @@ -10,3 +10,13 @@ client: ## @param client.enabled Enable or disable the vshnPostgres client ## enabled: false +## @section Resources requests and limits +resources: + ## @param resources.requests.memory Memory request for the container + requests: + memory: "500Mi" + ## @param resources.requests.cpu CPU request for the container + cpu: "100m" + limits: + ## @param resources.limits.memory Memory limit for the container + memory: "1Gi" diff --git a/vuepress/README.md b/vuepress/README.md index 4816851..0b76c8c 100644 --- a/vuepress/README.md +++ b/vuepress/README.md @@ -20,3 +20,11 @@ This Helm chart deploys a Vuepress site. | ----------------- | ------------------------------ | -------- | | `image` | The image for Vuepress | `""` | | `imagePullPolicy` | Pull policy for Vuepress image | `Always` | + +### Resources requests and limits + +| Name | Description | Value | +| --------------------------- | -------------------------------- | ------- | +| `resources.requests.memory` | Memory request for the container | `500Mi` | +| `resources.requests.cpu` | CPU request for the container | `100m` | +| `resources.limits.memory` | Memory limit for the container | `1Gi` | diff --git a/vuepress/templates/deploy.yaml b/vuepress/templates/deploy.yaml index 8decf30..4a3df48 100644 --- a/vuepress/templates/deploy.yaml +++ b/vuepress/templates/deploy.yaml @@ -19,3 +19,5 @@ spec: imagePullPolicy: {{ .Values.imagePullPolicy }} ports: - containerPort: 80 + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/vuepress/values.yaml b/vuepress/values.yaml index 05718a0..aecef69 100644 --- a/vuepress/values.yaml +++ b/vuepress/values.yaml @@ -17,3 +17,13 @@ image: "" ## @param imagePullPolicy Pull policy for Vuepress image ## imagePullPolicy: Always +## @section Resources requests and limits +resources: + ## @param resources.requests.memory Memory request for the container + requests: + memory: "500Mi" + ## @param resources.requests.cpu CPU request for the container + cpu: "100m" + limits: + ## @param resources.limits.memory Memory limit for the container + memory: "1Gi"