From 1581617daf57865a619330dea472ea5984d6f3cf Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Fri, 6 Dec 2024 23:45:36 +0100 Subject: [PATCH] fix(deployment): number of replicas --- .../prometheus-postgres-exporter/deployment.yaml | 1 + unittests/deployment/deployment.yaml | 11 +++++++++++ values.schema.json | 4 ++-- values.yaml | 4 ++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/templates/prometheus-postgres-exporter/deployment.yaml b/templates/prometheus-postgres-exporter/deployment.yaml index 7fd8f17..db16687 100644 --- a/templates/prometheus-postgres-exporter/deployment.yaml +++ b/templates/prometheus-postgres-exporter/deployment.yaml @@ -12,6 +12,7 @@ metadata: name: {{ include "prometheus-postgres-exporter.fullname" . }} namespace: {{ .Release.Namespace }} spec: + replicas: {{ .Values.deployment.replicas }} selector: matchLabels: {{- include "prometheus-postgres-exporter.pod.selectorLabels" . | nindent 6 }} diff --git a/unittests/deployment/deployment.yaml b/unittests/deployment/deployment.yaml index 5fdc25a..ab7c582 100644 --- a/unittests/deployment/deployment.yaml +++ b/unittests/deployment/deployment.yaml @@ -27,6 +27,9 @@ tests: app.kubernetes.io/name: prometheus-postgres-exporter app.kubernetes.io/version: 0.1.0 helm.sh/chart: prometheus-postgres-exporter-0.1.0 + - equal: + path: spec.replicas + value: 1 - contains: path: spec.template.spec.containers[0].envFrom content: @@ -91,6 +94,14 @@ tests: - notExists: path: spec.template.spec.topologySpreadConstraints +- it: Test custom replicas + set: + deployment.replicas: 3 + asserts: + - equal: + path: spec.replicas + value: 3 + - it: Test additional arguments set: deployment.postgresExporter.args: diff --git a/values.schema.json b/values.schema.json index 5ca9c16..df7e7d6 100644 --- a/values.schema.json +++ b/values.schema.json @@ -259,7 +259,7 @@ "priorityClassName": { "type": "string" }, - "replicaCount": { + "replicas": { "type": "integer" }, "restartPolicy": { @@ -326,7 +326,7 @@ "postgresExporter", "nodeSelector", "priorityClassName", - "replicaCount", + "replicas", "restartPolicy", "securityContext", "strategy", diff --git a/values.yaml b/values.yaml index 4dad1c4..5835db2 100644 --- a/values.yaml +++ b/values.yaml @@ -198,8 +198,8 @@ deployment: ## @param deployment.priorityClassName PriorityClassName of the postgres-exporter deployment. priorityClassName: "" - ## @param deployment.replicaCount Number of replicas for the postgres-exporter deployment. - replicaCount: 1 + ## @param deployment.replicas Number of replicas for the postgres-exporter deployment. + replicas: 1 ## @param deployment.restartPolicy Restart policy of the postgres-exporter deployment. restartPolicy: ""