Skip to content

Commit c48c1df

Browse files
authored
Merge pull request #8758 from zalando-incubator/support-internal-subnets
Add optional support for internel node subnets
2 parents 26bf3f9 + 9e31870 commit c48c1df

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

cluster/config-defaults.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,10 @@ control_plane_graceful_shutdown: "true"
11551155
# For rolling back it needs to be done in multiple stages: active -> serving -> pre -> none
11561156
control_plane_load_balancer_internal: "none"
11571157

1158+
# Optionally use internal subnets for running the nodes. This can be configured
1159+
# a node pool level to only run a subset of nodes in the internal subnets.
1160+
internal_node_subnets_enabled: "false"
1161+
11581162
# This allows setting custom sysctl settings. The config-item is intended to be
11591163
# used on node-pools rather being set globally.
11601164
#

cluster/node-pools/master-default/stack.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ Resources:
3737
PropagateAtLaunch: true
3838
Value: "{{ .NodePool.ConfigItems.pod_max_pids }}"
3939
VPCZoneIdentifier:
40-
{{ with $values := .Values }}
41-
{{ range $az := $values.availability_zones }}
42-
- "{{ index $values.subnets $az }}"
40+
{{ with $data := . }}
41+
{{ range $az := $data.Values.availability_zones }}
42+
# {{ if eq $data.NodePool.ConfigItems.internal_node_subnets_enabled "true" }}
43+
- "{{ index $data.Values.internal_node_subnets $az }}"
44+
# {{ else }}
45+
- "{{ index $data.Values.subnets $az }}"
46+
# {{ end }}
4347
{{ end }}
4448
{{ end }}
4549
TargetGroupARNs:

cluster/node-pools/worker-combined/stack.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ Resources:
117117
PropagateAtLaunch: true
118118
Value: "{{ .NodePool.ConfigItems.pod_max_pids }}"
119119
VPCZoneIdentifier:
120-
{{ with $values := .Values }}
121-
{{ range $az := $values.availability_zones }}
122-
- "{{ index $values.subnets $az }}"
120+
{{ with $data := . }}
121+
{{ range $az := $data.Values.availability_zones }}
122+
# {{ if eq $data.NodePool.ConfigItems.internal_node_subnets_enabled "true" }}
123+
- "{{ index $data.Values.internal_node_subnets $az }}"
124+
# {{ else }}
125+
- "{{ index $data.Values.subnets $az }}"
126+
# {{ end }}
123127
{{ end }}
124128
{{ end }}
125129
Type: 'AWS::AutoScaling::AutoScalingGroup'

cluster/node-pools/worker-karpenter/provisioners.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ spec:
1717
httpTokens: optional
1818
subnetSelectorTerms:
1919
- tags:
20+
# {{ if eq .NodePool.ConfigItems.internal_node_subnets_enabled "true" }}
21+
kubernetes.io/role/internal-node: "enabled"
22+
# {{ else }}
2023
kubernetes.io/role/karpenter: "enabled"
24+
# {{ end }}
2125
securityGroupSelectorTerms:
2226
- tags:
2327
karpenter.sh/discovery: "{{ .Cluster.ID }}/WorkerNodeSecurityGroup"

cluster/node-pools/worker-splitaz/stack.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ Resources:
123123
PropagateAtLaunch: true
124124
Value: "{{ $data.NodePool.ConfigItems.pod_max_pids }}"
125125
VPCZoneIdentifier:
126+
# {{ if eq $data.NodePool.ConfigItems.internal_node_subnets_enabled "true" }}
127+
- "{{ index $data.Values.internal_node_subnets $az }}"
128+
# {{ else }}
126129
- "{{ index $data.Values.subnets $az }}"
130+
# {{ end }}
127131
Type: 'AWS::AutoScaling::AutoScalingGroup'
128132
{{ end }}
129133
{{ end }}

0 commit comments

Comments
 (0)