@@ -180,6 +180,22 @@ func (b *NetworkModelBuilder) Build(c *fi.CloudupModelBuilderContext) error {
180180 DestinationApplicationSecurityGroupNames : []* string {fi .PtrTo (b .NameForApplicationSecurityGroupNodes ())},
181181 DestinationPortRange : fi .PtrTo ("*" ),
182182 })
183+ // Kindnet preserves pod-CIDR source IPs to host services; Azure NSG ASG
184+ // matching needs an explicit allow since pod IPs aren't NIC-assigned.
185+ // Scoped to nodes to keep DenyAllToControlPlane and the etcd denies effective.
186+ if b .Cluster .Spec .Networking .Kindnet != nil && b .Cluster .Spec .Networking .PodCIDR != "" {
187+ nsgTask .SecurityRules = append (nsgTask .SecurityRules , & azuretasks.NetworkSecurityRule {
188+ Name : fi .PtrTo ("AllowPodCIDRToNodes" ),
189+ Priority : fi.PtrTo [int32 ](1006 ),
190+ Access : network .SecurityRuleAccessAllow ,
191+ Direction : network .SecurityRuleDirectionInbound ,
192+ Protocol : network .SecurityRuleProtocolAsterisk ,
193+ SourceAddressPrefix : fi .PtrTo (b .Cluster .Spec .Networking .PodCIDR ),
194+ SourcePortRange : fi .PtrTo ("*" ),
195+ DestinationApplicationSecurityGroupNames : []* string {fi .PtrTo (b .NameForApplicationSecurityGroupNodes ())},
196+ DestinationPortRange : fi .PtrTo ("*" ),
197+ })
198+ }
183199 etcdPeerMax := wellknownports .EtcdEventsPeerPort
184200 for _ , c := range b .Cluster .Spec .EtcdClusters {
185201 if c .Name == "leases" {
0 commit comments