Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #91 from Nefelim4ag/fix_ipvs_flush
Browse files Browse the repository at this point in the history
Reset IPVS after API client init
  • Loading branch information
aledbf authored May 2, 2019
2 parents 9b88838 + c0472c5 commit 77c4173
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pkg/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (

configMapName = flags.String("services-configmap", "",
`Name of the ConfigMap that contains the definition of the services to expose.
The key in the map indicates the external IP to use. The value is the name of the
The key in the map indicates the external IP to use. The value is the name of the
service with the format namespace/serviceName and the port of the service could be a number or the
name of the port.`)

Expand All @@ -73,8 +73,8 @@ var (
}

vrid = flags.Int("vrid", 50,
`The keepalived VRID (Virtual Router Identifier, between 0 and 255 as per
RFC-5798), which must be different for every Virtual Router (ie. every
`The keepalived VRID (Virtual Router Identifier, between 0 and 255 as per
RFC-5798), which must be different for every Virtual Router (ie. every
keepalived sets) running on the same network.`)

iface = flags.String("iface", "", `network interface to listen on. If undefined, the nodes
Expand Down Expand Up @@ -123,11 +123,6 @@ func main() {
glog.Fatalf("unexpected error: %v", err)
}

err = resetIPVS()
if err != nil {
glog.Fatalf("unexpected error: %v", err)
}

if *proxyMode {
copyHaproxyCfg()
}
Expand All @@ -139,6 +134,14 @@ func main() {
glog.Info("starting LVS configuration")
ipvsc := controller.NewIPVSController(kubeClient, *watchNamespace, *useUnicast, *configMapName, *vrid, *proxyMode, *iface, *httpPort)

// If kube-proxy running in ipvs mode
// Reset of IPVS lead to connection loss with API server
// If connection established goclient will retry itself
err = resetIPVS()
if err != nil {
glog.Fatalf("unexpected error: %v", err)
}

ipvsc.Start()
}

Expand Down

0 comments on commit 77c4173

Please sign in to comment.