Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add networkpolicy in dsci #590

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions controllers/dscinitialization/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,33 +189,33 @@ func (r *DSCInitializationReconciler) reconcileDefaultNetworkPolicy(ctx context.
},
Spec: netv1.NetworkPolicySpec{
// open ingress for all port for now, TODO: add explicit port per component
Ingress: []netv1.NetworkPolicyIngressRule{{}},
// Ingress: []netv1.NetworkPolicyIngressRule{{}},
// open ingress for only ODH created namespaces
// this is tested on ROSA but not enough for PSI
// Ingress: []netv1.NetworkPolicyIngressRule{
// {
// From: []netv1.NetworkPolicyPeer{
// {
// NamespaceSelector: &metav1.LabelSelector{ // AND logic
// MatchLabels: map[string]string{
// "opendatahub.io/generated-namespace": "true",
// },
// },
// },
// },
// },
// { // OR logic
// From: []netv1.NetworkPolicyPeer{
// { // need this for access dashboard
// NamespaceSelector: &metav1.LabelSelector{
// MatchLabels: map[string]string{
// "kubernetes.io/metadata.name": "openshift-ingress",
// },
// },
// },
// },
// },
// },
Ingress: []netv1.NetworkPolicyIngressRule{
{
From: []netv1.NetworkPolicyPeer{
{
NamespaceSelector: &metav1.LabelSelector{ // AND logic
MatchLabels: map[string]string{
"opendatahub.io/generated-namespace": "true",
},
},
},
},
},
{ // OR logic
From: []netv1.NetworkPolicyPeer{
{ // need this for access dashboard
NamespaceSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"kubernetes.io/metadata.name": "openshift-ingress",
},
},
},
},
},
},
PolicyTypes: []netv1.PolicyType{
netv1.PolicyTypeIngress,
},
Expand Down
Loading