Skip to content

Commit 730bc95

Browse files
authored
Make replica count configurable across all deployment templates (#587)
1 parent 67759ff commit 730bc95

File tree

7 files changed

+28
-4
lines changed

7 files changed

+28
-4
lines changed

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: "replicaCount"
36+
default:
37+
disablePrompt: true
38+
value: 2
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: "replicaCount"
36+
default:
37+
disablePrompt: true
38+
value: 2
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: "replicaCount"
36+
default:
37+
disablePrompt: true
38+
value: 2
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/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: {{ .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" }}

test/templates/unsupported_no_of_containers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
app: my-app
77
kubernetes.azure.com/generator: draft
88
spec:
9-
replicas: 2
9+
replicas: 1
1010
selector:
1111
matchLabels:
1212
app: my-app

0 commit comments

Comments
 (0)