According to the documentation, if a Service (e.g., someservice
) has the property internalTrafficPolicy: Local
, the requests should be routed only to the available endpoints on the local node, with no fallback to other nodes.
In my case, each node has two workloads that match the Service selector. When traffic is sent to someservice
, kube-proxy balances the load between these two local endpoints as expected.
However, after deploying a new node and sending traffic to it, we observed an unexpected behavior. There were no workloads deployed on the new node that match the selector for someservice
.
Kubernetes version: v1.30.2
Docs: Service Internal Traffic Policy | Kubernetes
For pods on nodes with no endpoints for a given Service, the Service behaves as if it has zero endpoints (for Pods on this node) even if the service does have endpoints on other nodes.
We also tried testing the service using nc
. On the new node, the port wasn’t open, which confirms that no local endpoints were available, but traffic still went through successfully.
Expected behavior: The service should not send traffic at all since no local endpoints exist.
Actual behavior: The service still balances traffic across all available workloads and their endpoints on other nodes, despite the internalTrafficPolicy: Local
setting.
Question: Why does the Service and kube-proxy behave this way? Is this the expected behavior or a misconfiguration on our side?
Cluster information:
Kubernetes version: 1.30.2
Cloud being used: bare-metal
Installation method: kubespray
Host OS: almalinux
CNI and version: calico 3.27.3
CRI and version: containerd 1.7.16