add configurable neighbor address and bgp asn variable
hello, I want to make the neighbor address configurable via env var just like how the k8sipaddr
was configured so that it is easier to change it especially via gitops approach that I only update the neighbor address instead of copy pasting new bird configmap
with only changing the neighbor address for a different cluster/environment.
I can make a pr for this if it is approved and not someone already doing it.
I also have another idea, instead of updating the entrypoint.sh
to inject the bgp neighbor address var, we can instead add another config section as bird_vars
and mount the bird vars instead since the example daemonset already mount the whole config, and then in the bird conf we just reference the variable that we set in that bird_vars
, sth like this
---
apiVersion: v1
kind: ConfigMap
metadata:
name: bird
namespace: purelb
data:
birdvars.conf: |-
define k8sipaddr = K8SIPADDR;
define k8s_bgp_asn = 4200000003;
define bgp_neighbor = 192.168.0.1;
bird.conf: |-
log stderr all;
include "/usr/local/etc/birdvars.conf";
# ...
protocol bgp uplink1 {
local k8sipaddr as k8s_bgp_asn;
neighbor bgp_neighbor external;
# ...
}
and maybe we could also make this into single deploy.yml
file for this simple use case and for easier to deploy purelb bird router and user who use kustomization can easily edit birdvars.conf