Commit d0113493 authored by Murali Reddy's avatar Murali Reddy
Browse files

Enablg GoBGP logging from kube-router

Fixes #363
Showing with 12 additions and 0 deletions
+12 -0
......@@ -108,6 +108,7 @@ Usage of kube-router:
--cluster-asn uint ASN number under which cluster nodes will run iBGP.
--cluster-cidr string CIDR range of pods in the cluster. It is used to identify traffic originating from and destinated to pods.
--config-sync-period duration The delay between apiserver configuration synchronizations (e.g. '5s', '1m'). Must be greater than 0. (default 1m0s)
--enable-gobgp-logging Set --enable-gobgp-logging=true to print GoBGP logs
--enable-ibgp Enables peering with nodes with the same ASN, if disabled will only peer with external BGP peers (default true)
--enable-overlay When enable-overlay set to true, IP-in-IP tunneling is used for pod-to-pod networking across nodes in different subnets. When set to false no tunneling is used and routing infrastrcture is expected to route traffic for pod-to-pod networking across nodes in different subnets (default true)
--enable-pod-egress SNAT traffic from Pods to destinations outside the cluster. (default true)
......
......@@ -17,6 +17,7 @@ type KubeRouterConfig struct {
ClusterCIDR string
ConfigSyncPeriod time.Duration
EnableiBGP bool
EnableGoBGPLogging bool
EnableOverlay bool
EnablePodEgress bool
EnablePprof bool
......@@ -126,4 +127,5 @@ func (s *KubeRouterConfig) AddFlags(fs *pflag.FlagSet) {
// "Password that cluster-node BGP servers will use to authenticate one another when \"--nodes-full-mesh\" is set.")
fs.StringVarP(&s.VLevel, "v", "v", "0", "log level for V logs")
fs.Uint16Var(&s.HealthPort, "health-port", 20244, "Health check port, 0 = Disabled")
fs.BoolVar(&s.EnableGoBGPLogging, "enable-gobgp-logging", s.EnableGoBGPLogging, "Set --enable-gobgp-logging=true to print GoBGP logs")
}
......@@ -13,6 +13,7 @@ import (
"github.com/cloudnativelabs/kube-router/app/options"
"github.com/golang/glog"
log "github.com/sirupsen/logrus"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
......@@ -134,6 +135,14 @@ func (kr *KubeRouter) Run() error {
}
if kr.Config.RunRouter {
// enable GoBGP debug log
if kr.Config.EnableGoBGPLogging {
log.SetLevel(log.DebugLevel)
} else {
log.SetLevel(log.WarnLevel)
}
nrc, err := controllers.NewNetworkRoutingController(kr.Client, kr.Config, nodeInformer, svcInformer, epInformer)
if err != nil {
return errors.New("Failed to create network routing controller: " + err.Error())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment