projectcalico / calico

Cloud native networking and network security
https://docs.tigera.io/calico/latest/about/
Apache License 2.0
5.97k stars 1.33k forks source link

Can't add merge paths switch to template section #2711

Closed EricVS closed 4 years ago

EricVS commented 5 years ago

Expected Behavior

We have a RKE Kubernetes cluster, using Calico as network plugin and BIRD as Calico backend. I can't find the way to add 'merge paths switch 2' to the template section in bird.conf. This is needed to 'see' our two paths for HA.

Current Behavior

Unable to add a required command to the template section.

Possible Solution

How to interact with confd and the bird.conf

Context

It blocks us from having multiple paths on our Kubernetes network while they are configured and working on the host.

Your Environment

Autogenerated bird.conf (redacted)

# Generated by confd
include "bird_aggr.cfg";
include "bird_ipam.cfg";

router id REDACTED;

# Configure synchronization between routing tables and kernel.
protocol kernel {
  learn;             # Learn all alien routes from the kernel
  persist;           # Don't remove routes on bird shutdown
  scan time 2;       # Scan kernel routing table every 2 seconds
  import all;
  export filter calico_kernel_programming; # Default is export none
  graceful restart;  # Turn on graceful restart to reduce potential flaps in
                     # routes when reloading BIRD configuration.  With a full
                     # automatic mesh, there is no way to prevent BGP from
                     # flapping since multiple nodes update their BGP
                     # configuration at the same time, GR is not guaranteed to
                     # work correctly in this scenario.
}

# Watch interface up/down events.
protocol device {
  debug { states };
  scan time 2;    # Scan interfaces every 2 seconds
}

protocol direct {
  debug { states };
  interface -"cali*", "*"; # Exclude cali* but include everything else.
}

# Template for all BGP clients
template bgp bgp_template {
  debug { states };
  description "Connection to BGP peer";
  local as REDACTED;
  multihop;
  gateway recursive; # This should be the default, but just in case.
  import all;        # Import all routes, since we don't know what the upstream
                     # topology is and therefore have to trust the ToR/RR.
  export filter calico_export_to_bgp_peers;  # Only want to export routes for workloads.
  source address REDACTED;  # The local address we use for the TCP connection
  add paths on;
  graceful restart;  # See comment in kernel section about graceful restart.
  connect delay time 2;
  connect retry time 5;
  error wait time 5,30;
}

# ------------- Node-to-node mesh -------------

# Node-to-node mesh disabled

# ------------- Global peers -------------
# No global peers configured.

# ------------- Node-specific peers -------------

# For peer /host/REDACTED/peer_v4/REDACTED
protocol bgp Node_REDACTED from bgp_template {
  neighbor REDACTED as REDACTED;
}

# For peer /host/REDACTED/peer_v4/REDACTED
protocol bgp Node_REDACTED from bgp_template {
  neighbor REDACTED as REDACTED;
}

Desired config (only the template section)

# Template for all BGP clients
template bgp bgp_template {
  debug { states };
  description "Connection to BGP peer";
  local as REDACTED;
  multihop;
  merge paths switch 2
  gateway recursive; # This should be the default, but just in case.
  import all;        # Import all routes, since we don't know what the upstream
                     # topology is and therefore have to trust the ToR/RR.
  export filter calico_export_to_bgp_peers;  # Only want to export routes for workloads.
  source address REDACTED;  # The local address we use for the TCP connection
  add paths on;
  graceful restart;  # See comment in kernel section about graceful restart.
  connect delay time 2;
  connect retry time 5;
  error wait time 5,30;
}
rafaelvanoni commented 5 years ago

Just trying to understand what you're trying to do here.. is this a new template or just a configuration that you'd like to add to an existing one?

EricVS commented 5 years ago

Hi Rafael,

Thanks for your reply. What I was looking for is modifying an existing template, the one for bird.cfg. Due to our network setup I needed to add a couple of lines to the 'kernel' section and I couldn't find a 'clean' way to do it. We are using RKE and things like the asNumber I can update but nothing in the kernel section AFAIK. For now I'm using a 'workaround' by just putting all the templates in a Kubernetes configMap and mounting that one in the template directory from within the daemonSet. If there is a way I would appreciate if you could point me in the right direction or towards the documentation.

Kind regards,

Eric Van Steenbergen

E-mail: vs.eric@gmail.com vs.eric@gmail.com Skype: ericvs2014 LinkedIn: Eric Van Steenbergen http://es.linkedin.com/pub/eric-van-steenbergen/b/8a4/51b

On Tue, Jul 16, 2019 at 5:10 AM Rafael Vanoni notifications@github.com wrote:

Just trying to understand what you're trying to do here.. is this a new template or just a configuration that you'd like to add to an existing one?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/projectcalico/calico/issues/2711?email_source=notifications&email_token=AACCAP34EQTTI27JDQHTLRLP7TRTFA5CNFSM4H7A24J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ67KEQ#issuecomment-511571218, or mute the thread https://github.com/notifications/unsubscribe-auth/AACCAPZUZTL67H5HPPSX2OLP7TRTFANCNFSM4H7A24JQ .

tmjd commented 5 years ago

There isn't a supported way for modifying the bird templates currently, I think what you are doing is the best option at this time for modifying them.

If you would like to open a feature request issue or even better submit a PR to make it configurable through other means that would be great.