Skip to content

Commit b1d8724

Browse files
committed
Make internal subnet control associate-public-ip
Signed-off-by: Mikkel Oscar Lyderik Larsen <[email protected]>
1 parent 6db727f commit b1d8724

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

cluster/config-defaults.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ karpenter_max_pods_per_node: "32"
4444
# legacy => 0.36.2-main-25.patched
4545
karpenter_version: "current"
4646

47-
# Configure whether to associate public ip when launching instances.
48-
associate_public_ip_on_launch: "true"
49-
5047
# ALB config created by kube-aws-ingress-controller
5148
kube_aws_ingress_controller_ssl_policy: "ELBSecurityPolicy-TLS-1-2-2017-01"
5249
kube_aws_ingress_controller_idle_timeout: "1m"
@@ -1157,8 +1154,14 @@ control_plane_load_balancer_internal: "none"
11571154

11581155
# Optionally use internal subnets for running the nodes. This can be configured
11591156
# a node pool level to only run a subset of nodes in the internal subnets.
1157+
# If this is true then `associate_public_ip_on_launch` is automatically treated
1158+
# as false.
11601159
internal_node_subnets_enabled: "false"
11611160

1161+
# Configure whether to associate public ip when launching instances.
1162+
# This is only relevant when `internal_node_subnets_enabled` is false.
1163+
associate_public_ip_on_launch: "true"
1164+
11621165
# This allows setting custom sysctl settings. The config-item is intended to be
11631166
# used on node-pools rather being set globally.
11641167
#

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Resources:
8585
VolumeType: gp3
8686
NetworkInterfaces:
8787
- DeviceIndex: 0
88-
# {{ if eq .NodePool.ConfigItems.associate_public_ip_on_launch "true" }}
88+
# {{ if and (eq .NodePool.ConfigItems.associate_public_ip_on_launch "true") (ne .NodePool.ConfigItems.internal_node_subnets_enabled "true") }}
8989
AssociatePublicIpAddress: true
9090
# {{ end }}
9191
Groups:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ Resources:
154154
VolumeType: gp3
155155
NetworkInterfaces:
156156
- DeviceIndex: 0
157+
# {{ if and (eq .NodePool.ConfigItems.associate_public_ip_on_launch "true") (ne .NodePool.ConfigItems.internal_node_subnets_enabled "true") }}
157158
AssociatePublicIpAddress: true
159+
# {{ end }}
158160
Groups:
159161
- !ImportValue '{{ .Cluster.ID }}:worker-security-group'
160162
EbsOptimized: false

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
securityGroupSelectorTerms:
2626
- tags:
2727
karpenter.sh/discovery: "{{ .Cluster.ID }}/WorkerNodeSecurityGroup"
28-
# {{ if eq .NodePool.ConfigItems.associate_public_ip_on_launch "true" }}
28+
# {{ if and (eq .NodePool.ConfigItems.associate_public_ip_on_launch "true") (ne .NodePool.ConfigItems.internal_node_subnets_enabled "true") }}
2929
associatePublicIPAddress: true
3030
# {{ end }}
3131
instanceProfile: "{{ .Cluster.ID | awsValidID }}-WorkerKarpenter-InstanceProfile"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Resources:
159159
VolumeType: gp3
160160
NetworkInterfaces:
161161
- DeviceIndex: 0
162-
# {{ if eq .NodePool.ConfigItems.associate_public_ip_on_launch "true" }}
162+
# {{ if and (eq .NodePool.ConfigItems.associate_public_ip_on_launch "true") (ne .NodePool.ConfigItems.internal_node_subnets_enabled "true") }}
163163
AssociatePublicIpAddress: true
164164
# {{ end }}
165165
Groups:

0 commit comments

Comments
 (0)