Skip to content

Commit 401f109

Browse files
robinlioretRobin LIORET
authored andcommitted
feat: helm v2-alpha: add nodeSelector, toleration and affinity to the chart
Signed-off-by: Robin LIORET <robin.lioret@darylsocialsoftware.com>
1 parent e2bc0ac commit 401f109

File tree

19 files changed

+394
-33
lines changed

19 files changed

+394
-33
lines changed

docs/book/src/cronjob-tutorial/testdata/project/config/manager/manager.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ spec:
5050
# operator: In
5151
# values:
5252
# - linux
53+
# TODO(user): Uncomment the following code to configure the nodeSelector.
54+
# nodeSelector:
55+
# kubernetes.io/os: linux
56+
# TODO(user): Uncomment the following code to configure the tolerations.
57+
# tolerations:
58+
# - key: "key1"
59+
# operator: "Exists"
60+
# effect: "NoSchedule"
5361
securityContext:
5462
# Projects are configured by default to adhere to the "restricted" Pod Security Standards.
5563
# This ensures that deployments meet the highest security requirements for Kubernetes.

docs/book/src/cronjob-tutorial/testdata/project/dist/chart/templates/manager/manager.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ spec:
2121
app.kubernetes.io/name: project
2222
control-plane: controller-manager
2323
spec:
24+
{{- with .Values.manager.tolerations }}
25+
tolerations: {{ toYaml . | nindent 16 }}
26+
{{- end }}
27+
{{- with .Values.manager.affinity }}
28+
affinity: {{ toYaml . | nindent 16 }}
29+
{{- end }}
30+
{{- with .Values.manager.nodeSelector }}
31+
nodeSelector: {{ toYaml . | nindent 16 }}
32+
{{- end }}
2433
containers:
2534
- args:
2635
{{- if .Values.metrics.enable }}

docs/book/src/cronjob-tutorial/testdata/project/dist/chart/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ manager:
3737
cpu: 10m
3838
memory: 64Mi
3939

40+
# Pod's affinity
41+
affinity: {}
42+
43+
# Pod's node selector
44+
nodeSelector: {}
45+
46+
# Pod's tolerations
47+
tolerations: []
48+
4049
# Essential RBAC permissions (required for controller operation)
4150
# These include ServiceAccount, controller permissions, leader election, and metrics access
4251
# Note: Essential RBAC is always enabled as it's required for the controller to function

docs/book/src/getting-started/testdata/project/config/manager/manager.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ spec:
5050
# operator: In
5151
# values:
5252
# - linux
53+
# TODO(user): Uncomment the following code to configure the nodeSelector.
54+
# nodeSelector:
55+
# kubernetes.io/os: linux
56+
# TODO(user): Uncomment the following code to configure the tolerations.
57+
# tolerations:
58+
# - key: "key1"
59+
# operator: "Exists"
60+
# effect: "NoSchedule"
5361
securityContext:
5462
# Projects are configured by default to adhere to the "restricted" Pod Security Standards.
5563
# This ensures that deployments meet the highest security requirements for Kubernetes.

docs/book/src/getting-started/testdata/project/dist/chart/templates/manager/manager.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ spec:
2121
app.kubernetes.io/name: project
2222
control-plane: controller-manager
2323
spec:
24+
{{- with .Values.manager.tolerations }}
25+
tolerations: {{ toYaml . | nindent 16 }}
26+
{{- end }}
27+
{{- with .Values.manager.affinity }}
28+
affinity: {{ toYaml . | nindent 16 }}
29+
{{- end }}
30+
{{- with .Values.manager.nodeSelector }}
31+
nodeSelector: {{ toYaml . | nindent 16 }}
32+
{{- end }}
2433
containers:
2534
- args:
2635
{{- if .Values.metrics.enable }}

docs/book/src/getting-started/testdata/project/dist/chart/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ manager:
3737
cpu: 10m
3838
memory: 64Mi
3939

40+
# Pod's affinity
41+
affinity: {}
42+
43+
# Pod's node selector
44+
nodeSelector: {}
45+
46+
# Pod's tolerations
47+
tolerations: []
48+
4049
# Essential RBAC permissions (required for controller operation)
4150
# These include ServiceAccount, controller permissions, leader election, and metrics access
4251
# Note: Essential RBAC is always enabled as it's required for the controller to function

docs/book/src/multiversion-tutorial/testdata/project/config/manager/manager.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ spec:
5050
# operator: In
5151
# values:
5252
# - linux
53+
# TODO(user): Uncomment the following code to configure the nodeSelector.
54+
# nodeSelector:
55+
# kubernetes.io/os: linux
56+
# TODO(user): Uncomment the following code to configure the tolerations.
57+
# tolerations:
58+
# - key: "key1"
59+
# operator: "Exists"
60+
# effect: "NoSchedule"
5361
securityContext:
5462
# Projects are configured by default to adhere to the "restricted" Pod Security Standards.
5563
# This ensures that deployments meet the highest security requirements for Kubernetes.

docs/book/src/multiversion-tutorial/testdata/project/dist/chart/templates/manager/manager.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ spec:
2121
app.kubernetes.io/name: project
2222
control-plane: controller-manager
2323
spec:
24+
{{- with .Values.manager.tolerations }}
25+
tolerations: {{ toYaml . | nindent 16 }}
26+
{{- end }}
27+
{{- with .Values.manager.affinity }}
28+
affinity: {{ toYaml . | nindent 16 }}
29+
{{- end }}
30+
{{- with .Values.manager.nodeSelector }}
31+
nodeSelector: {{ toYaml . | nindent 16 }}
32+
{{- end }}
2433
containers:
2534
- args:
2635
{{- if .Values.metrics.enable }}

docs/book/src/multiversion-tutorial/testdata/project/dist/chart/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ manager:
3737
cpu: 10m
3838
memory: 64Mi
3939

40+
# Pod's affinity
41+
affinity: {}
42+
43+
# Pod's node selector
44+
nodeSelector: {}
45+
46+
# Pod's tolerations
47+
tolerations: []
48+
4049
# Essential RBAC permissions (required for controller operation)
4150
# These include ServiceAccount, controller permissions, leader election, and metrics access
4251
# Note: Essential RBAC is always enabled as it's required for the controller to function

pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/manager/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ spec:
9696
# operator: In
9797
# values:
9898
# - linux
99+
# TODO(user): Uncomment the following code to configure the nodeSelector.
100+
# nodeSelector:
101+
# kubernetes.io/os: linux
102+
# TODO(user): Uncomment the following code to configure the tolerations.
103+
# tolerations:
104+
# - key: "key1"
105+
# operator: "Exists"
106+
# effect: "NoSchedule"
99107
securityContext:
100108
# Projects are configured by default to adhere to the "restricted" Pod Security Standards.
101109
# This ensures that deployments meet the highest security requirements for Kubernetes.

0 commit comments

Comments
 (0)