e34270c51e
This creates a new section in calico/values.yaml that enables BGP communities to be applied to a cidr by using the bird_ipam templates. Change-Id: I4dbbc8d8e761e0484eeb7c8bf0fefa28d29493e5
37 lines
948 B
Smarty
37 lines
948 B
Smarty
# Generated by confd
|
|
|
|
function osh_filters ()
|
|
{
|
|
# support any addresses matching our secondary announcements
|
|
{{- range .Values.networking.bgp.ipv6.additional_cidrs }}
|
|
if ( net ~ {{ . }} ) then { accept; }
|
|
{{- end }}
|
|
}
|
|
|
|
function apply_communities ()
|
|
{
|
|
# Set community value based on dictionary of cidrs
|
|
{{- $asnum := .Values.networking.bgp.asnumber }}
|
|
{{- range .Values.networking.bgp.ipv6.community_cidr_ref }}
|
|
{{- $community := .community }}
|
|
{{- $cidr := .cidr }}
|
|
{{- with .prefix }}
|
|
if ( net ~ {{ $cidr }} ) then { bgp_community.add(({{ . }}, {{ $community }})); }
|
|
{{- else }}
|
|
if ( net ~ {{ $cidr }} ) then { bgp_community.add(({{ $asnum }}, {{ $community }})); }
|
|
{{- end }}
|
|
{{- end }}
|
|
}
|
|
|
|
filter calico_pools {
|
|
apply_communities();
|
|
calico_aggr();
|
|
osh_filters();
|
|
{{`{{range ls "/pool"}}{{$data := json (getv (printf "/pool/%s" .))}}`}}
|
|
{{` if ( net ~ {{$data.cidr}} ) then {`}}
|
|
accept;
|
|
}
|
|
{{`{{end}}`}}
|
|
reject;
|
|
}
|