Skip to content

Commit 67b70fa

Browse files
authored
fix(vd): allow ingress from virtualization namespace to importer pods (#2356)
When a namespace has a restrictive NetworkPolicy (e.g. project isolation), the CDI controller from d8-virtualization cannot reach importer pods to fetch progress metrics via HTTP. As a result, DataVolume.Status.Progress stays N/A and VirtualDisk shows no intermediate progress. Add an Ingress rule to the NetworkPolicy created for importer/DVCR pods, allowing incoming traffic from the namespace labeled module=virtualization. This enables the CDI controller to scrape progress metrics from importer pods even in isolated namespaces. Signed-off-by: Pavel Tishkov <pavel.tishkov@flant.com>
1 parent ea96363 commit 67b70fa

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

images/virtualization-artifact/pkg/common/network_policy/network_policy.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,21 @@ func CreateNetworkPolicy(ctx context.Context, c client.Client, obj metav1.Object
5252
},
5353
},
5454
},
55+
Ingress: []netv1.NetworkPolicyIngressRule{
56+
{
57+
From: []netv1.NetworkPolicyPeer{
58+
{
59+
NamespaceSelector: &metav1.LabelSelector{
60+
MatchLabels: map[string]string{
61+
"module": "virtualization",
62+
},
63+
},
64+
},
65+
},
66+
},
67+
},
5568
Egress: []netv1.NetworkPolicyEgressRule{{}},
56-
PolicyTypes: []netv1.PolicyType{netv1.PolicyTypeEgress},
69+
PolicyTypes: []netv1.PolicyType{netv1.PolicyTypeIngress, netv1.PolicyTypeEgress},
5770
},
5871
}
5972

0 commit comments

Comments
 (0)