Skip to content

Commit c8d315a

Browse files
committed
Allowing configuring associatePublicIp
Signed-off-by: Mikkel Oscar Lyderik Larsen <[email protected]>
1 parent 62cc974 commit c8d315a

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

cluster/config-defaults.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ 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+
4750
# ALB config created by kube-aws-ingress-controller
4851
kube_aws_ingress_controller_ssl_policy: "ELBSecurityPolicy-TLS-1-2-2017-01"
4952
kube_aws_ingress_controller_idle_timeout: "1m"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ Resources:
8181
VolumeType: gp3
8282
NetworkInterfaces:
8383
- DeviceIndex: 0
84+
# {{ if eq .Cluster.ConfigItems.associate_public_ip_on_launch "true" }}
8485
AssociatePublicIpAddress: true
86+
# {{ end }}
8587
Groups:
8688
- !ImportValue '{{ .Cluster.ID }}:master-security-group'
8789
EbsOptimized: false

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ spec:
2121
securityGroupSelectorTerms:
2222
- tags:
2323
karpenter.sh/discovery: "{{ .Cluster.ID }}/WorkerNodeSecurityGroup"
24+
# {{ if eq .Cluster.ConfigItems.associate_public_ip_on_launch "true" }}
2425
associatePublicIPAddress: true
26+
# {{ end }}
2527
instanceProfile: "{{ .Cluster.ID | awsValidID }}-WorkerKarpenter-InstanceProfile"
2628
blockDeviceMappings:
2729
- deviceName: /dev/sda1

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ Resources:
155155
VolumeType: gp3
156156
NetworkInterfaces:
157157
- DeviceIndex: 0
158+
# {{ if eq .Cluster.ConfigItems.associate_public_ip_on_launch "true" }}
158159
AssociatePublicIpAddress: true
160+
# {{ end }}
159161
Groups:
160162
- !ImportValue '{{ .Cluster.ID }}:worker-security-group'
161163
EbsOptimized: false

0 commit comments

Comments
 (0)