From f39dba8cc3f9de055216d6b0f676b5c3e328b657 Mon Sep 17 00:00:00 2001 From: Chris Werner Rau Date: Mon, 15 Apr 2024 14:31:18 +0200 Subject: [PATCH] feat(base-cluster): overhaul resources (#835) --- charts/base-cluster/values.schema.json | 60 +++++++++++++--- charts/base-cluster/values.yaml | 96 ++++++++------------------ 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/charts/base-cluster/values.schema.json b/charts/base-cluster/values.schema.json index d318b3131..1580ad5bb 100644 --- a/charts/base-cluster/values.schema.json +++ b/charts/base-cluster/values.schema.json @@ -350,8 +350,10 @@ "$ref": "#/$defs/email" } }, + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { - "type": "object", "$ref": "#/$defs/resourceRequirements" } }, @@ -437,6 +439,9 @@ "type": "integer", "minimum": 1 }, + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" }, @@ -463,6 +468,9 @@ "operator": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" } @@ -472,6 +480,9 @@ "kubeStateMetrics": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" }, @@ -492,6 +503,9 @@ "nodeExporter": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" } @@ -633,12 +647,18 @@ "type": "string" } }, + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" }, "sidecar": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" } @@ -670,12 +690,18 @@ "type": "integer", "minimum": 1 }, + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" }, "promtail": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" } @@ -827,6 +853,9 @@ "certManager": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" }, @@ -838,6 +867,9 @@ "webhook": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" } @@ -847,6 +879,9 @@ "caInjector": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" } @@ -870,6 +905,9 @@ "externalDNS": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" } @@ -1054,6 +1092,9 @@ "type": "integer", "minimum": 1 }, + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" }, @@ -1175,6 +1216,9 @@ "backup": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" }, @@ -1292,6 +1336,9 @@ "nodeAgent": { "type": "object", "properties": { + "resourcesPreset": { + "$ref": "#/$defs/resourcesPreset" + }, "resources": { "$ref": "#/$defs/resourceRequirements" } @@ -1331,16 +1378,7 @@ "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master-standalone-strict/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements" }, "resourcesPreset": { - "type": "string", - "enum": [ - "nano", - "micro", - "small", - "medium", - "large", - "xlarge", - "2xlarge" - ] + "$ref": "https://raw.githubusercontent.com/teutonet/teutonet-helm-charts/main/charts/common/values.schema.json#/$defs/resourcesPreset" }, "quantity": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master-standalone-strict/_definitions.json#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" diff --git a/charts/base-cluster/values.yaml b/charts/base-cluster/values.yaml index f57f03c58..68e9ac884 100644 --- a/charts/base-cluster/values.yaml +++ b/charts/base-cluster/values.yaml @@ -184,6 +184,7 @@ global: roleAttributePath: '"''Viewer''"' oauthProxy: emailDomains: [] + resourcesPreset: nano resources: limits: cpu: 100m @@ -211,21 +212,11 @@ monitoring: additionalDashboards: {} additionalPlugins: [] notifiers: [] - resources: - requests: - cpu: 50m - memory: 256Mi - limits: - cpu: 500m - memory: 256Mi + resourcesPreset: nano + resources: {} sidecar: - resources: - requests: - cpu: 10m - memory: 128Mi - limits: - cpu: 500m - memory: 128Mi + resourcesPreset: nano + resources: {} storageCostAnalysis: currency: currencyEUR period: Day @@ -244,29 +235,14 @@ monitoring: persistence: storageClass: "" size: 100Gi - resources: - requests: - cpu: "250m" - memory: 2Gi - limits: - cpu: "500m" - memory: 2Gi + resourcesPreset: large + resources: {} operator: - resources: - requests: - cpu: 50m - memory: 256Mi - limits: - cpu: 500m - memory: 512Mi + resourcesPreset: nano + resources: {} kubeStateMetrics: - resources: - requests: - cpu: 50m - memory: 128Mi - limits: - cpu: 100m - memory: 512Mi + resourcesPreset: nano + resources: {} metricLabelsAllowList: pods: - app.kubernetes.io/name @@ -282,13 +258,14 @@ monitoring: - app.kubernetes.io/component - app.kubernetes.io/instance nodeExporter: + resourcesPreset: nano resources: requests: - cpu: 50m - memory: 64Mi + cpu: 10m + memory: 32Mi limits: - cpu: "2" - memory: 128Mi + cpu: 2 + memory: 64Mi ingress: host: prometheus customDomain: "" @@ -312,6 +289,7 @@ monitoring: storageClass: "" size: 10Gi replicas: 1 + resourcesPreset: nano resources: requests: cpu: 100m @@ -320,6 +298,7 @@ monitoring: cpu: 1 memory: 1Gi promtail: + resourcesPreset: nano resources: requests: cpu: 50m @@ -378,40 +357,26 @@ dns: provider: null certManager: - resources: - limits: - cpu: 250m - memory: 512Mi - requests: - cpu: 100m - memory: 512Mi + resourcesPreset: nano + resources: {} caInjector: - resources: - limits: - cpu: 250m - memory: 512Mi - requests: - cpu: 50m - memory: 512Mi + resourcesPreset: nano + resources: {} webhook: - resources: - limits: - cpu: 1 - memory: 512Mi - requests: - cpu: 100m - memory: 512Mi + resourcesPreset: nano + resources: {} dnsChallengeNameservers: 1.1.1.1: 53 externalDNS: + resourcesPreset: nano resources: - limits: - cpu: 50m - memory: 128Mi requests: cpu: 10m memory: 64Mi + limits: + cpu: 50m + memory: 128Mi flux: gitRepositories: {} @@ -420,13 +385,10 @@ ingress: enabled: true allowNginxConfigurationSnippets: false replicas: 2 + resourcesPreset: nano resources: - requests: - cpu: 100m - memory: 90Mi limits: cpu: 1 - memory: 256Mi storage: readWriteMany: