Skip to content

Commit

Permalink
fix(nsc): sync hairpinning on service modification
Browse files Browse the repository at this point in the history
When we receive service or endpoint updates from Kubernetes we process a
type of partial sync because the service and endpoints have already been
updated by the handler. However, previously, this partial update did not
include updating the hairpinning rules for services.

This would cause hairpinning changes to be delayed until the next full
sync or until kube-router restart. This changes adds hairpinning into
the partial service sync flow.
  • Loading branch information
aauren committed Dec 3, 2021
1 parent 8f13f06 commit 146786a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/controllers/proxy/network_services_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,14 @@ func (nsc *NetworkServicesController) Run(healthChan chan<- *healthcheck.Control
klog.V(1).Info("Performing requested sync of ipvs services")
nsc.mu.Lock()
err = nsc.syncIpvsServices(nsc.serviceMap, nsc.endpointsMap)
nsc.mu.Unlock()
if err != nil {
klog.Errorf("Error during ipvs sync in network service controller. Error: " + err.Error())
}
err = nsc.syncHairpinIptablesRules()
if err != nil {
klog.Errorf("Error syncing hairpin iptables rules: %s", err.Error())
}
nsc.mu.Unlock()
}
if err == nil {
healthcheck.SendHeartBeat(healthChan, "NSC")
Expand Down

0 comments on commit 146786a

Please sign in to comment.