-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Kind CNI Does Not Support Default Deny Network Policy #3705
Comments
This has been implemented recently and is only available on the main branch |
NetworkPolicy isn't part of Kubernetes conformance and current kind releases did not implement NetworkPolicy at all That's not a bug. However, there will be a network policy implementation feature in the next release, which will happen around when Kubernetes 1.31 releases if all goes well. /kind feature You can try this in advance if you install the latest kind sources https://kind.sigs.k8s.io/docs/user/quick-start/#installation |
Ah, I see. Thanks for the clarification. |
I've just tried this with the latest release, and the policy in the example above still isn't being applied Can anyone else confirm? |
I can't repro, I see that if I try to curl it hangs, but if I |
I installed kind v0.24.0 then ran Are you doing anything different? It's totally possible that we have a bug, but I seem to see the expected behavior when using kind v0.24.0 and the default node image (which is Kubernetes v1.31.0, with the https://github.com/kubernetes-sigs/kube-network-policies integration in kindnetd) |
Also @network-charles sorry for the confusion, this has been a longstanding request / gap and you're far from the first to see this as a bug / surprise. It was an intentional choice previously to focus on shipping only what is required for fully conformant APIs and not anything less standardized as a way to help prevent scope creep and encourage developing with portable APIs and avoid ... competition over whose third party implementation would be provided in Kubernetes's upstream test tools. ... but network policy is part of the core standards, and now we have the minimal upstream implementation at https://github.com/kubernetes-sigs/kube-network-policies, so as of this morning https://github.com/kubernetes-sigs/kind/releases/tag/v0.24.0 is finally out with network policy support out of the box. |
Previously tracked in: #842 |
I can confirm that this has been fixed in |
Does the fact that I'm using WSL2 matter? As this still isn't working for me Ive had to go back to using calico for now |
When you execute “kind --version” you ought to see v0.24.0. If you did and you still experience this error, it could be a WSL2 issue. |
Yeah that's the version I'm seeing. Must be a WSL2 specific issue then |
I can't see why, you need to use one of the images linked here https://github.com/kubernetes-sigs/kind/releases/tag/v0.24.0 if it still fails just do a tarball from the |
I'm using the latest image. I'm on mobile atm, so will grab some logs when I get the chance and add here |
I have the same problem on WSL2 (Ubuntu 20.04) using Kind v0.24.0 with 1.31 image: the network policy rules have no effect. In the
Both
This Ubuntu version is still using iptables. So I guess we need to configure Anyway, can we reopen this issue? |
you need the nft-queue kernel module |
Oh, thanks.
Is it possible to configure |
we already had similar problems with WSL2 kernels see https://kind.sigs.k8s.io/docs/user/using-wsl2/#kubernetes-service-with-session-affinity It seems there are two options, run a custom kernel https://learn.microsoft.com/en-us/answers/questions/1426263/how-to-enable-modules-in-wsl2 or request the wsl2 kernel to enable this module by default https://github.com/microsoft/WSL2-Linux-Kernel?tab=readme-ov-file
it is more nuanced like that, in a first stage we have iptables support but the iptables infrastructure lack some features that made that solution not sustainable . The kernel and kubernetes communities are also moving to nftables , so it is better for WSL2 to support nftables , since today is this problem but tomorrow it will be other |
What happened:
After applying a default deny policy, the pod could still communicate. I had to install Calico for it to work.
What you expected to happen:
Pods shouldn't be able to communicate between themselves.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
No
Environment:
kind version
): kind v0.23.0 go1.21.10 linux/amd64docker info
):/etc/os-release
):kubectl version
):The text was updated successfully, but these errors were encountered: