-
Notifications
You must be signed in to change notification settings - Fork 40.5k
externalIPs DNAT rules are not installed when clusterIP is None #131497
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
Comments
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/sig network |
This commit fixes an issue where DNAT rules for external IPs are not installed by kube-proxy when a service has clusterIP: None (headless service). The issue was specific to kube-proxy's nftables mode implementation. The fix: 1. Adds isHeadless field to BaseServicePortInfo to track headless services 2. Modifies UsesClusterEndpoints() to handle headless services consistently 3. Ensures headless services bypass cluster endpoints while still getting proper DNAT rules for external IPs Added TestUsesClusterEndpoints to verify the behavior for: - Normal services with external IPs - Headless services with external IPs - Headless services without external IPs Fixes kubernetes#131497
@ttc0419 kube-proxy does noy handle headless services, it ignores headless services, so it is not possible to add ips for those. You can see that iptables kube-proxy behaves the same, what it seems is a bug in validation for Services, does it make sense for a headless service to have external IPs? /cc @danwinship @thockin |
Maybe I want a monolithic service to be only accessible from outside and I do not want to waste a cluster ip for it. |
What happened?
Consider the following service:
But no DNAT rules for the external IP:
What did you expect to happen?
External IP service DNAT rules should be installed, like when clusterIP is not None:
How can we reproduce it (as minimally and precisely as possible)?
Apply the yaml
Anything else we need to know?
No response
Kubernetes version
1.33.2
Cloud provider
N/A
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: