Skip to content

Commit 42827fc

Browse files
committed
feat: make replica count configurable across all deployment templates
- Add REPLICACOUNT variable to helm, kustomize, and manifest deployment templates - Set default value to 1 replica for all deployment types - Replace hardcoded replica values with template variables - Update all test fixtures to reflect new default replica count - Ensure consistency across deployment template types
1 parent 67759ff commit 42827fc

File tree

12 files changed

+33
-9
lines changed

12 files changed

+33
-9
lines changed

pkg/fixtures/deployments/helm/charts/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Default values for testapp.
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
4-
replicaCount: 2
4+
replicaCount: 1
55

66
namespace: default
77

pkg/fixtures/deployments/kustomize/base/deployment-override-workload-identity.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
kubernetes.azure.com/generator: draft
88
namespace: default
99
spec:
10-
replicas: 2
10+
replicas: 1
1111
selector:
1212
matchLabels:
1313
app.kubernetes.io/name: testapp

pkg/fixtures/deployments/kustomize/base/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
kubernetes.azure.com/generator: draft
88
namespace: default
99
spec:
10-
replicas: 2
10+
replicas: 1
1111
selector:
1212
matchLabels:
1313
app.kubernetes.io/name: testapp

pkg/fixtures/deployments/manifest/manifests/deployment-override-workload-identity.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
kubernetes.azure.com/generator: draft
88
namespace: default
99
spec:
10-
replicas: 2
10+
replicas: 1
1111
selector:
1212
matchLabels:
1313
app.kubernetes.io/name: testapp

pkg/fixtures/deployments/manifest/manifests/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
kubernetes.azure.com/generator: draft
88
namespace: default
99
spec:
10-
replicas: 2
10+
replicas: 1
1111
selector:
1212
matchLabels:
1313
app.kubernetes.io/name: testapp

template/deployments/helm/charts/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Default values for {{ .Config.GetVariableValue "APPNAME"}}.
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
4-
replicaCount: 2
4+
replicaCount: {{ .Config.GetVariableValue "REPLICACOUNT" }}
55

66
namespace: {{ .Config.GetVariableValue "NAMESPACE" }}
77

template/deployments/helm/draft.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ variables:
3030
value: default
3131
description: " the namespace to place new resources in"
3232
versions: ">=0.0.1"
33+
- name: "REPLICACOUNT"
34+
type: "int"
35+
kind: "kubernetesReplicas"
36+
default:
37+
disablePrompt: true
38+
value: 1
39+
description: "the number of replicas for the deployment"
40+
versions: ">=0.0.1"
3341
- name: "IMAGENAME"
3442
type: "string"
3543
kind: "containerImageName"

template/deployments/kustomize/base/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
kubernetes.azure.com/generator: {{ .Config.GetVariableValue "GENERATORLABEL" }}
88
namespace: {{ .Config.GetVariableValue "NAMESPACE" }}
99
spec:
10-
replicas: 2
10+
replicas: {{ .Config.GetVariableValue "REPLICACOUNT" }}
1111
selector:
1212
matchLabels:
1313
app.kubernetes.io/name: {{ .Config.GetVariableValue "APPNAME" }}

template/deployments/kustomize/draft.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ variables:
3030
value: default
3131
description: " the namespace to place new resources in"
3232
versions: ">=0.0.1"
33+
- name: "REPLICACOUNT"
34+
type: "int"
35+
kind: "kubernetesReplicas"
36+
default:
37+
disablePrompt: true
38+
value: 1
39+
description: "the number of replicas for the deployment"
40+
versions: ">=0.0.1"
3341
- name: "IMAGENAME"
3442
type: "string"
3543
kind: "containerImageName"

template/deployments/manifests/draft.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ variables:
3030
value: default
3131
description: " the namespace to place new resources in"
3232
versions: ">=0.0.1"
33+
- name: "REPLICACOUNT"
34+
type: "int"
35+
kind: "kubernetesReplicas"
36+
default:
37+
disablePrompt: true
38+
value: 1
39+
description: "the number of replicas for the deployment"
40+
versions: ">=0.0.1"
3341
- name: "IMAGENAME"
3442
type: "string"
3543
kind: "containerImageName"

0 commit comments

Comments
 (0)