@@ -545,19 +545,19 @@ func (nsc *NetworkServicesController) syncIpvsServices(serviceInfoMap serviceInf
545545 protocol = syscall .IPPROTO_NONE
546546 }
547547
548- // assign cluster IP of the service to the dummy interface so that its routable from the pod's on the node
549- err := nsc .ln .ipAddrAdd (dummyVipInterface , svc .clusterIP .String (), true )
550- if err != nil {
551- continue
552- }
553-
554548 endpoints := endpointsInfoMap [k ]
555549
556550 if ! hasActiveEndpoints (svc , endpoints , nsc .podCidr ) {
557551 glog .V (1 ).Infof ("Skipping service %s/%s as it does not have active endpoints\n " , svc .namespace , svc .name )
558552 continue
559553 }
560554
555+ // assign cluster IP of the service to the dummy interface so that its routable from the pod's on the node
556+ err := nsc .ln .ipAddrAdd (dummyVipInterface , svc .clusterIP .String (), true )
557+ if err != nil {
558+ continue
559+ }
560+
561561 // create IPVS service for the service to be exposed through the cluster ip
562562 ipvsClusterVipSvc , err := nsc .ln .ipvsAddService (ipvsSvcs , svc .clusterIP , protocol , uint16 (svc .port ), svc .sessionAffinity , svc .scheduler )
563563 if err != nil {
@@ -1752,6 +1752,11 @@ func (ln *linuxNetworking) setupRoutesForExternalIPForDSR(serviceInfoMap service
17521752 for _ , svc := range serviceInfoMap {
17531753 for _ , externalIP := range svc .externalIPs {
17541754 activeExternalIPs [externalIP ] = true
1755+ // Verify the DSR annotation exists
1756+ if ! svc .directServerReturn {
1757+ glog .V (1 ).Infof ("Skipping service %s/%s as it does not have DSR annotation\n " , svc .namespace , svc .name )
1758+ continue
1759+ }
17551760
17561761 if ! strings .Contains (outStr , externalIP ) {
17571762 if err = exec .Command ("ip" , "route" , "add" , externalIP , "dev" , "kube-bridge" , "table" ,
0 commit comments