mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-09-26 18:41:05 +02:00
feat(NSC): add / clarify log messages
This commit is contained in:
parent
d757f49d55
commit
d3cf4d13a7
@ -1025,6 +1025,7 @@ func (nsc *NetworkServicesController) buildEndpointSliceInfo() endpointSliceInfo
|
||||
for _, obj := range nsc.epSliceLister.List() {
|
||||
var isIPv4, isIPv6 bool
|
||||
es := obj.(*discovery.EndpointSlice)
|
||||
klog.V(2).Infof("Building endpoint info for EndpointSlice: %s/%s", es.Namespace, es.Name)
|
||||
switch es.AddressType {
|
||||
case discovery.AddressTypeIPv4:
|
||||
isIPv4 = true
|
||||
@ -1073,6 +1074,7 @@ func (nsc *NetworkServicesController) buildEndpointSliceInfo() endpointSliceInfo
|
||||
// changing this to .Serving which continues to include pods that are in Terminating state. For now we keep
|
||||
// it the same.
|
||||
if ep.Conditions.Ready == nil || !*ep.Conditions.Ready {
|
||||
klog.V(2).Infof("Endpoint (with addresses %s) does not have a ready status, skipping...", ep.Addresses)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -145,6 +145,7 @@ func (nsc *NetworkServicesController) setupClusterIPServices(serviceInfoMap serv
|
||||
// node
|
||||
err = nsc.ln.ipAddrAdd(dummyVipInterface, clusterIP.String(), nodeIP, true)
|
||||
if err != nil {
|
||||
// Not logging an error here because it was already logged in the ipAddrAdd function
|
||||
continue
|
||||
}
|
||||
|
||||
@ -153,6 +154,7 @@ func (nsc *NetworkServicesController) setupClusterIPServices(serviceInfoMap serv
|
||||
protocol, uint16(svc.port))
|
||||
// We weren't able to create the IPVS service, so we won't be able to add endpoints to it
|
||||
if svcID == "" {
|
||||
// not logging an error here because it was already logged in the addIPVSService function
|
||||
continue
|
||||
}
|
||||
|
||||
@ -191,12 +193,16 @@ func (nsc *NetworkServicesController) addEndpointsToIPVSService(endpoints []endp
|
||||
family = v1.IPv6Protocol
|
||||
}
|
||||
|
||||
if len(endpoints) < 1 {
|
||||
klog.Infof("No endpoints detected for service VIP: %s, skipping adding endpoints...", vip)
|
||||
}
|
||||
for _, endpoint := range endpoints {
|
||||
// Conditions on which to add an endpoint on this node:
|
||||
// 1) Service is not a local service
|
||||
// 2) Service is a local service, but has no active endpoints on this node
|
||||
// 3) Service is a local service, has active endpoints on this node, and this endpoint is one of them
|
||||
if svc.local && !endpoint.isLocal {
|
||||
klog.V(2).Info("service is local, but endpoint is not, continuing...")
|
||||
continue
|
||||
}
|
||||
var syscallINET uint16
|
||||
@ -227,12 +233,12 @@ func (nsc *NetworkServicesController) addEndpointsToIPVSService(endpoints []endp
|
||||
}
|
||||
err := nsc.ln.ipvsAddServer(ipvsSvc, &dst)
|
||||
if err != nil {
|
||||
klog.Errorf(err.Error())
|
||||
} else {
|
||||
klog.Errorf("encountered error adding endpoint to service: %v", err)
|
||||
continue
|
||||
}
|
||||
svcEndpointMap[svcID] = append(svcEndpointMap[svcID],
|
||||
generateEndpointID(endpoint.ip, strconv.Itoa(endpoint.port)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (nsc *NetworkServicesController) setupNodePortServices(serviceInfoMap serviceInfoMap,
|
||||
@ -336,7 +342,8 @@ func (nsc *NetworkServicesController) setupExternalIPServices(serviceInfoMap ser
|
||||
}
|
||||
}
|
||||
if !addrsFound {
|
||||
klog.V(1).Infof("no IP addresses returned for external service %s:%s", svc.namespace, svc.name)
|
||||
klog.V(1).Infof("no external IP addresses returned for service %s:%s skipping...",
|
||||
svc.namespace, svc.name)
|
||||
continue
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user