Skip to content

Commit e0f7e7d

Browse files
JamesMarinodevoncrouse
authored andcommitted
fix: added kubernetes api control plane network access for pods
Signed-off-by: James Marino <[email protected]>
1 parent 1a23cbf commit e0f7e7d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

modules/network/locals.tf

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ locals {
120120
]
121121

122122
# Network Security Group ingress rules for control plane subnet (Flannel & VCN-Native Pod networking)
123-
cp_ingress = [
123+
cp_ingress = concat(var.cni_type == "npn" ? local.cp_ingress_npn : [], [
124124
{
125125
description = "Allow worker nodes to control plane API endpoint communication"
126126
protocol = local.tcp_protocol,
@@ -153,6 +153,26 @@ locals {
153153
source_type = "CIDR_BLOCK",
154154
stateless = false
155155
},
156+
])
157+
158+
# Network Security Group ingress rules for control plane subnet (Only VCN-Native Pod networking)
159+
cp_ingress_npn = [
160+
{
161+
description = "Allow pods to control plane API endpoint communication"
162+
protocol = local.tcp_protocol,
163+
port = 6443,
164+
source = local.pods_subnet,
165+
source_type = "CIDR_BLOCK",
166+
stateless = false
167+
},
168+
{
169+
description = "Allow pods to control plane communication"
170+
protocol = local.tcp_protocol,
171+
port = 12250,
172+
source = local.pods_subnet,
173+
source_type = "CIDR_BLOCK",
174+
stateless = false
175+
},
156176
]
157177

158178
# Network Security Group egress rules for workers subnet (Flannel & VCN-Native Pod networking)

0 commit comments

Comments
 (0)