Skip to content
Merged
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
14 changes: 14 additions & 0 deletions pkg/proxy/iptables/proxier.go
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,20 @@ func (proxier *Proxier) syncProxyRules() {
hasEndpoints = len(allEndpoints) > 0
}

// Prefer local endpoint for the DNS service.
// Fixes <https://bugzilla.redhat.com/show_bug.cgi?id=1919737>.
// TODO: Delete this if-block once internal traffic policy is
// implemented and the DNS operator is updated to use it.
if svcNameString == "openshift-dns/dns-default:dns" {
for _, ep := range allEndpoints {
if ep.GetIsLocal() {
klog.V(4).Infof("Found a local endpoint %q for service %q; preferring the local endpoint and ignoring %d other endpoints", ep.String(), svcNameString, len(allEndpoints) - 1)
allEndpoints = []proxy.Endpoint{ep}
break
}
}
}

svcChain := svcInfo.servicePortChainName
if hasEndpoints {
// Create the per-service chain, retaining counters if possible.
Expand Down