From 32e28ee31f366c3aa308df86daa558bf90624108 Mon Sep 17 00:00:00 2001 From: adobrodey <8377544+ADobrodey@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:06:53 +0200 Subject: [PATCH] [VDEVOPS-000]: Update resources management Signed-off-by: adobrodey <8377544+ADobrodey@users.noreply.github.com> --- stable/deployment/Chart.yaml | 2 +- stable/deployment/README.md | 8 +------ stable/deployment/values.schema.json | 20 +++++------------ stable/deployment/values.yaml | 31 +++++++++++---------------- stable/statefulset/Chart.yaml | 2 +- stable/statefulset/README.md | 10 ++------- stable/statefulset/values.schema.json | 22 ++++++------------- stable/statefulset/values.yaml | 31 +++++++++++---------------- 8 files changed, 42 insertions(+), 84 deletions(-) diff --git a/stable/deployment/Chart.yaml b/stable/deployment/Chart.yaml index bf2d5d3..c2642bf 100644 --- a/stable/deployment/Chart.yaml +++ b/stable/deployment/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: deployment -version: 1.8.0 +version: 1.8.1 description: Typical microservice chart. Supports Ingress controller, horizontal-scalable containers type: application dependencies: diff --git a/stable/deployment/README.md b/stable/deployment/README.md index 49a5f3e..433d7a9 100644 --- a/stable/deployment/README.md +++ b/stable/deployment/README.md @@ -110,6 +110,7 @@ Typical microservice chart. Supports Ingress controller, horizontal-scalable con | `sidecarContainers` | Configuration for the init container | `[]` | | `datadogIntegration` | Enable datadog related integration for tracing | `false` | | `githubActionsIntegration` | Allow github runners to create resources in namespace | `false` | +| `resources` | Container resource requests and limits | `{}` | ### Image for the deployment @@ -235,13 +236,6 @@ Typical microservice chart. Supports Ingress controller, horizontal-scalable con | `metrics.rules.enabled` | Create PrometheusRules object | `false` | | `metrics.rules.spec` | Configuration for the application alerting | `[]` | -### Container resource requests and limits - -| Name | Description | Value | -| -------------------- | ---------------------------------------- | ----- | -| `resources.limits` | The resources limits for the container | `{}` | -| `resources.requests` | The requests resources for the container | `{}` | - ### Lifecycle configuration | Name | Description | Value | diff --git a/stable/deployment/values.schema.json b/stable/deployment/values.schema.json index d50bdac..9bcf74b 100644 --- a/stable/deployment/values.schema.json +++ b/stable/deployment/values.schema.json @@ -228,6 +228,11 @@ "description": "Allow github runners to create resources in namespace", "default": false }, + "resources": { + "type": "object", + "description": "Container resource requests and limits", + "default": {} + }, "image": { "type": "object", "properties": { @@ -643,21 +648,6 @@ } } }, - "resources": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "description": "The resources limits for the container", - "default": {} - }, - "requests": { - "type": "object", - "description": "The requests resources for the container", - "default": {} - } - } - }, "lifecycle": { "type": "object", "properties": { diff --git a/stable/deployment/values.yaml b/stable/deployment/values.yaml index 2511007..e9ab508 100644 --- a/stable/deployment/values.yaml +++ b/stable/deployment/values.yaml @@ -171,7 +171,7 @@ topologySpreadConstraintPreset: soft ## topologySpreadConstraints: {} ## @param resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). -## This is ignored if server.resources is set (server.resources is recommended for production). +## This is ignored if resources is set (resources is recommended for production). ## More information: https://github.com/vinivia/kubernetes-helm-charts/blob/main/global/k8s-common/templates/_resources.tpl#L9 ## resourcesPreset: "nano" @@ -224,6 +224,18 @@ datadogIntegration: false ## E.g. ## githubActionsIntegration: true githubActionsIntegration: false +## @param resources Container resource requests and limits +## ref: https://kubernetes.io/docs/user-guide/compute-resources/ +## +## E.g. +## resources: +## requests: +## cpu: 10m +## memory: 50Mi +## limits: +## cpu: 50m +## memory: 50Mi +resources: {} ## @section Image for the deployment ## image: @@ -560,23 +572,6 @@ metrics: ## resolved for this cloud to continue to maintain state. ## spec: [ ] -## @section Container resource requests and limits -## ref: https://kubernetes.io/docs/user-guide/compute-resources/ -resources: - ## @param resources.limits The resources limits for the container - ## E.g. - ## limits: - ## cpu: 50m - ## memory: 50Mi - ## - limits: { } - ## @param resources.requests The requests resources for the container - ## E.g. - ## requests: - ## cpu: 10m - ## memory: 50Mi - ## - requests: { } ## @section Lifecycle configuration ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/ lifecycle: diff --git a/stable/statefulset/Chart.yaml b/stable/statefulset/Chart.yaml index b7f006a..ea91456 100644 --- a/stable/statefulset/Chart.yaml +++ b/stable/statefulset/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: statefulset -version: 1.8.0 +version: 1.8.1 description: Typical StateFul Set application type: application dependencies: diff --git a/stable/statefulset/README.md b/stable/statefulset/README.md index 92873bc..24f6c16 100644 --- a/stable/statefulset/README.md +++ b/stable/statefulset/README.md @@ -80,7 +80,8 @@ Typical StateFul Set application | `tolerations` | Tolerations for pod assignment | `[]` | | `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | -| `resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). | `nano` | +| `resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). | `none` | +| `resources` | Container resource requests and limits | `{}` | | `nodeAffinityPreset` | Node affinity preset | | | `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `nodeAffinityPreset.key` | Node label key to match Ignored if `affinity` is set. | `""` | @@ -221,13 +222,6 @@ Typical StateFul Set application | `metrics.rules.enabled` | Create PrometheusRules object | `false` | | `metrics.rules.spec` | Configuration for the application alerting | `[]` | -### Container resource requests and limits - -| Name | Description | Value | -| -------------------- | ---------------------------------------- | ----- | -| `resources.limits` | The resources limits for the container | `{}` | -| `resources.requests` | The requests resources for the container | `{}` | - ### Lifecycle configuration | Name | Description | Value | diff --git a/stable/statefulset/values.schema.json b/stable/statefulset/values.schema.json index 7442b6a..f4def54 100644 --- a/stable/statefulset/values.schema.json +++ b/stable/statefulset/values.schema.json @@ -163,7 +163,12 @@ "resourcesPreset": { "type": "string", "description": "Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge).", - "default": "nano" + "default": "none" + }, + "resources": { + "type": "object", + "description": "Container resource requests and limits", + "default": {} }, "nodeAffinityPreset": { "type": "object", @@ -644,21 +649,6 @@ } } }, - "resources": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "description": "The resources limits for the container", - "default": {} - }, - "requests": { - "type": "object", - "description": "The requests resources for the container", - "default": {} - } - } - }, "lifecycle": { "type": "object", "properties": { diff --git a/stable/statefulset/values.yaml b/stable/statefulset/values.yaml index e6fa1cf..1cc035e 100644 --- a/stable/statefulset/values.yaml +++ b/stable/statefulset/values.yaml @@ -142,7 +142,19 @@ podAntiAffinityPreset: soft ## This is ignored if server.resources is set (server.resources is recommended for production). ## More information: https://github.com/vinivia/kubernetes-helm-charts/blob/main/global/k8s-common/templates/_resources.tpl#L9 ## -resourcesPreset: "nano" +resourcesPreset: "none" +## @param resources Container resource requests and limits +## ref: https://kubernetes.io/docs/user-guide/compute-resources/ +## +## E.g. +## resources: +## requests: +## cpu: 10m +## memory: 50Mi +## limits: +## cpu: 50m +## memory: 50Mi +resources: {} ## @extra nodeAffinityPreset Node affinity preset ## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity ## @@ -537,23 +549,6 @@ metrics: ## resolved for this cloud to continue to maintain state. ## spec: [] -## @section Container resource requests and limits -## ref: https://kubernetes.io/docs/user-guide/compute-resources/ -resources: - ## @param resources.limits The resources limits for the container - ## E.g. - ## limits: - ## cpu: 50m - ## memory: 50Mi - ## - limits: {} - ## @param resources.requests The requests resources for the container - ## E.g. - ## requests: - ## cpu: 10m - ## memory: 50Mi - ## - requests: {} ## @section Lifecycle configuration ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/ lifecycle: