Skip to content

Commit

Permalink
Optionally support dedicated pod subnets
Browse files Browse the repository at this point in the history
Signed-off-by: Mikkel Oscar Lyderik Larsen <[email protected]>
  • Loading branch information
mikkeloscar committed Nov 5, 2024
1 parent 0a7121e commit 5013bad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions provisioner/clusterpy.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
tagNameKubernetesClusterPrefix = "kubernetes.io/cluster/"
subnetELBRoleTagName = "kubernetes.io/role/elb"
subnetNodeRoleTagName = "kubernetes.io/role/node"
subnetPodRoleTagName = "kubernetes.io/role/pod"
resourceLifecycleShared = "shared"
resourceLifecycleOwned = "owned"
mainStackTagKey = "cluster-lifecycle-controller.zalando.org/main-stack"
Expand Down Expand Up @@ -222,6 +223,7 @@ func (p *clusterpyProvisioner) provision(
// find the best subnet for each AZ
azInfoLBs := selectSubnetIDs(subnets, subnetELBRoleTagName)
azInfoNodes := selectSubnetIDs(subnets, subnetNodeRoleTagName)
azInfoPods := selectSubnetIDs(subnets, subnetPodRoleTagName)

// if availability zones are defined, filter the subnet list
if azNames, ok := cluster.ConfigItems[availabilityZonesConfigItemKey]; ok {
Expand Down Expand Up @@ -266,6 +268,7 @@ func (p *clusterpyProvisioner) provision(
availabilityZonesValueKey: azInfoNodes.AvailabilityZones(),
subnetIPV6CIDRsKey: strings.Join(azInfoNodes.SubnetIPv6CIDRs(), ","),
"lb_subnets": azInfoLBs.SubnetsByAZ(),
"pod_subnets": azInfoPods.SubnetsByAZ(),
"hosted_zone": hostedZone,
"load_balancer_certificate": loadBalancerCert.ID(),
"vpc_ipv4_cidr": aws.StringValue(vpc.CidrBlock),
Expand Down

0 comments on commit 5013bad

Please sign in to comment.