From 20a488ce247b8aecc48329430c17c057a4762cf1 Mon Sep 17 00:00:00 2001 From: Jose Macchi Date: Tue, 1 Oct 2024 09:50:00 -0300 Subject: [PATCH] Fix documentation. Remove unnecessary setup --- templates/hpa.yaml | 8 +------- values.md | 4 ++-- values.schema.json | 6 ++++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/templates/hpa.yaml b/templates/hpa.yaml index 6b78f01..5d502b1 100644 --- a/templates/hpa.yaml +++ b/templates/hpa.yaml @@ -4,14 +4,8 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - {{- if hasKey $serviceDefinition.hpa "name" }} - name: {{ $serviceDefinition.hpa.name }} - {{- else }} name: {{ include "common.fullname" (dict "root" $ "service" $serviceDefinition "serviceName" $serviceName ) }}-hpa - {{- end }} - {{- $hpaDict := deepCopy $serviceDefinition }} - {{- $hpaDict := merge $hpaDict (dict "annotations" $serviceDefinition.hpa.annotations "labels" $serviceDefinition.hpa.labels) }} - {{- include "common.metadata" (dict "root" $ "service" $hpaDict "serviceName" $serviceName) | nindent 2 }} + {{- include "common.metadata" ( dict "root" $ "service" $serviceDefinition "serviceName" $serviceName ) | nindent 2 }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/values.md b/values.md index 93576c4..df21a47 100644 --- a/values.md +++ b/values.md @@ -212,8 +212,8 @@ - **`ports`** _(array)_ - **`hpa`** _(object)_ - **`enabled`** _(boolean, required)_: Enable or disable HPA for the service. - - **`minReplicas`** _(integer, required)_: Minimal number of replicas. Minimum: `1`. - - **`maxReplicas`** _(integer, required)_: Max number of replicas. Minimum: `1`. + - **`minReplicas`** _(integer, required)_: Minimal number of replicas. Minimum: `1`. Default: `1`. + - **`maxReplicas`** _(integer, required)_: Max number of replicas. Minimum: `1`. Default: `10`. - **`metrics`** _(array)_: Metrics definition. - **Items** _(object)_ - **`type`** _(string, required)_: Metric types (Resource, Pods, External). Must be one of: `["Resource", "Pods", "External"]`. diff --git a/values.schema.json b/values.schema.json index 8fbdcc6..a0cb9a3 100644 --- a/values.schema.json +++ b/values.schema.json @@ -1095,12 +1095,14 @@ "minReplicas": { "type": "integer", "minimum": 1, - "description": "Minimal number of replicas." + "description": "Minimal number of replicas.", + "default": 1 }, "maxReplicas": { "type": "integer", "minimum": 1, - "description": "Max number of replicas." + "description": "Max number of replicas.", + "default": 10 }, "metrics": { "type": "array",