Skip to content

Commit 103f835

Browse files
aledbfroboquat
authored andcommitted
[installer] Add network policy for coredns
1 parent fe64389 commit 103f835

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

install/installer/pkg/common/networkpolicies.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,24 @@ func AllowKubeDnsEgressRule() v1.NetworkPolicyEgressRule {
3030
},
3131
},
3232
},
33-
To: []v1.NetworkPolicyPeer{{
34-
PodSelector: &metav1.LabelSelector{
35-
MatchLabels: map[string]string{
36-
"k8s-app": "kube-dns",
33+
// Enable access to DNS service in the cluster: kube-dns or coredns
34+
To: []v1.NetworkPolicyPeer{
35+
{
36+
PodSelector: &metav1.LabelSelector{
37+
MatchLabels: map[string]string{
38+
"k8s-app": "kube-dns",
39+
},
3740
},
41+
NamespaceSelector: &metav1.LabelSelector{},
42+
}, {
43+
PodSelector: &metav1.LabelSelector{
44+
MatchLabels: map[string]string{
45+
"k8s-app": "coredns",
46+
},
47+
},
48+
NamespaceSelector: &metav1.LabelSelector{},
3849
},
39-
NamespaceSelector: &metav1.LabelSelector{},
40-
}},
50+
},
4151
}
4252

4353
return dnsEgressRule

0 commit comments

Comments
 (0)