Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resources:
- service-account.yaml
- service.yaml
- configmap.yaml
- network-policy.yaml
Copy link
Contributor

@andyatmiami andyatmiami Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are starting to move network policies to within components (from kubeflow/manifests where these definitions reside today) - what should we do about the https://github.com/kubeflow/manifests/blob/master/common/networkpolicies/base/default-allow-same-namespace.yaml file?

Seems like we should a networkpolicy to allow traffic within the kubeflow namespace also defined somewhere in this repo (?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very good question!

My proposal is that every repo should own the NetworkPolicies of its components, and the kubeflow/manifests should own resources that should live in the kubeflow namespace, and don't target/configure a workload that is owned by another repo.

But this should have a dedicated issue (I'm trying to create one, but GH doesn't allow me to create it!)
image

So for this PR, I'd suggest we only copy the ones that are specific to components of this repo. And continue the discussion about "generic" resources in kubeflow to kubeflow/manifests, as this can be generalised to other resources.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly orthogonal, we could also create a NetworkPolicy that allows only the dashboard to talk to access-management, so that we don't rely at all in the NetworkPolicy in the kubeflow namespace.

But was thinking of not introducing a new functionality outside of the overall one yet, as I would treat it as a dedicated feature. But if you feel strongly otherwise let me know @andyatmiami @juliusvonkohout

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am comfortable with that response - appreciate the follow up!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, for now focusing on "feature parity" I think is good ... so we can deal with adding new functionality once the general release process has been vetted (imho)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created also kubeflow/manifests#3261 to track the discussion for the policies

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Slightly orthogonal, we could also create a NetworkPolicy that allows only the dashboard to talk to access-management, so that we don't rely at all in the NetworkPolicy in the kubeflow namespace." Yes that should be done and you also need to add tests to verify that the networkpolicy blocks it.

images:
- name: ghcr.io/kubeflow/dashboard/dashboard-angular
newName: ghcr.io/kubeflow/dashboard/dashboard-angular
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: dashboard-angular
spec:
podSelector:
matchExpressions:
- key: app
operator: In
values:
- dashboard-angular
ingress:
- from:
- namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: In
values:
- istio-system
- podSelector: {}
policyTypes:
- Ingress
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resources:
- service-account.yaml
- service.yaml
- configmap.yaml
- network-policy.yaml
images:
- name: ghcr.io/kubeflow/dashboard/dashboard
newName: ghcr.io/kubeflow/dashboard/dashboard
Expand Down
22 changes: 22 additions & 0 deletions components/centraldashboard/manifests/base/network-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: dashboard
spec:
podSelector:
matchExpressions:
- key: app
operator: In
values:
- dashboard
ingress:
- from:
- namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: In
values:
- istio-system
- podSelector: {}
policyTypes:
- Ingress
9 changes: 9 additions & 0 deletions testing/shared/test_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ case "$OPERATION" in
-H "kubeflow-userid: test-user" \
"http://localhost:${PORT}/api/workgroup/exists" \
>/dev/null 2>&1

# test the NetworkPolicy, by ensuring other Pods timeout talking to the dashboard
OUTPUT=$(kubectl run \
netshoot-test --rm -i \
--restart=Never \
--image nicolaka/netshoot \
-- curl dashboard.kubeflow.svc --connect-timeout 5 \
2>&1 || true)
echo $OUTPUT | grep "Connection timed out after"
;;

"test-kfam")
Expand Down