-
Notifications
You must be signed in to change notification settings - Fork 10
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
Network Policy Rule Evaluation Blocks Traffic to DNS Server #146
Comments
If you enable network policy event logs, do you see the toggle from accept to block? Looking at the event logs can shed more details on what is happening with these evaluation rules. |
Network policy controller is creating policy endpoint rules in a way that when we have conflicting rules, precedence is to DENY over ALLOW. Based on upstream recommendation we should do a ALLOW in such cases. This needs a change in Network Policy Controller. We are looking into it and will update on the fix here. Policy endpoint generated for the above network policy
For your specific case, providing explicit CIDR "10.0.0.0/8" in the second rule should fix the issue. Let us know if this works for you as a workaround |
thanks for the clarification @Pavani-Panakanti. I've got another issue that some cronjob that tries to push metrics to prometheus pushgateway within the same cluster fails sporadically due to network policies, but they sometimes succeed on retry. After removing the network policy, the job always succeeded. Do you have any hints why? ---- Update below with my findings ---- I have a cronjob I tried to increase the CPU requests for the |
@junzebao It is expected to take 1-2 secs for the new pod to be reconciled and updated on the SVC1 side. 8 secs delay should not be happening. Can you send the logs of both the nodes egress and ingress where you saw the 8 secs delay for the reconciliation of new pod IP to |
After I enabled Is there any way to solve this? or is this the expected behavior and we have to work around it? |
@junzebao This is expected behavior. Once the new pod is created, it takes some short time for its IP to be published in all network policies to reach an eventual consistent state and from here it should work without any issues. Services are expected to handle these by having retries.
|
@Pavani-Panakanti is this issue related to aws/aws-network-policy-agent#345? |
What happened:
I created a new EKS clusters and enabled network policy in the VPC-CNI, but I realized the following
NetworkPolicy
blocks the dns resolution requests. It was working when I used Calico as the network plugin.Attach logs
What you expected to happen:
The first rule would block DNS requests to kube-dns (172.20.0.10 in our case), but the second rule should allow the request.
How to reproduce it (as minimally and precisely as possible):
Create a pod with label
app: curl
in the default namespace as the NetworkPolicy on an EKS cluster with network policy enabled in VPC-CNI. I attached this config to the EKS addon{ "enableNetworkPolicy": "true" }
.Anything else we need to know?:
Environment:
kubectl version
):Client Version: v1.31.1, Server Version: v1.30.5-eks-ce1d5eb
cat /etc/os-release
): Linux Bottlerocket OS 1.22.0 (aws-k8s-1.30)uname -a
):The text was updated successfully, but these errors were encountered: