Skip to content

Commit

Permalink
feat(nsc): add more insight into sync steps
Browse files Browse the repository at this point in the history
  • Loading branch information
aauren committed Sep 23, 2023
1 parent b03f3b7 commit f8d9812
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/controllers/proxy/service_endpoints_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,53 @@ func (nsc *NetworkServicesController) syncIpvsServices(serviceInfoMap serviceInf
// cluster IP, nodeport and external IP services
activeServiceEndpointMap := make(map[string][]string)

klog.V(1).Info("Syncing ClusterIP Services")
err = nsc.setupClusterIPServices(serviceInfoMap, endpointsInfoMap, activeServiceEndpointMap)
if err != nil {
syncErrors = true
klog.Errorf("Error setting up IPVS services for service cluster IP's: %s", err.Error())
}

klog.V(1).Info("Syncing NodePort Services")
err = nsc.setupNodePortServices(serviceInfoMap, endpointsInfoMap, activeServiceEndpointMap)
if err != nil {
syncErrors = true
klog.Errorf("Error setting up IPVS services for service nodeport's: %s", err.Error())
}

klog.V(1).Info("Syncing ExternalIP Services")
err = nsc.setupExternalIPServices(serviceInfoMap, endpointsInfoMap, activeServiceEndpointMap)
if err != nil {
syncErrors = true
klog.Errorf("Error setting up IPVS services for service external IP's and load balancer IP's: %s",
err.Error())
}

klog.V(1).Info("Cleaning Up Stale VIPs from dummy interface")
err = nsc.cleanupStaleVIPs(activeServiceEndpointMap)
if err != nil {
syncErrors = true
klog.Errorf("Error cleaning up stale VIP's configured on the dummy interface: %s", err.Error())
}

klog.V(1).Info("Cleaning Up Stale VIPs from IPVS")
err = nsc.cleanupStaleIPVSConfig(activeServiceEndpointMap)
if err != nil {
syncErrors = true
klog.Errorf("Error cleaning up stale IPVS services and servers: %s", err.Error())
}

klog.V(1).Info("Cleaning Up Stale metrics")
nsc.cleanupStaleMetrics(activeServiceEndpointMap)

klog.V(1).Info("Syncing IPVS Firewall")
err = nsc.syncIpvsFirewall()
if err != nil {
syncErrors = true
klog.Errorf("Error syncing ipvs svc iptables rules to permit traffic to service VIP's: %s", err.Error())
}

klog.V(1).Info("Setting up DSR Services")
err = nsc.setupForDSR(serviceInfoMap)
if err != nil {
syncErrors = true
Expand Down

0 comments on commit f8d9812

Please sign in to comment.