Skip to content

Commit 80d4b7a

Browse files
authored
Merge pull request #212 from karampok/unnumbered
Support unnumbered BGP peering
2 parents 55ce611 + 79f4f21 commit 80d4b7a

25 files changed

+999
-1357
lines changed

API-DOCS.md

+1
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ _Appears in:_
285285
| `dynamicASN` _[DynamicASNMode](#dynamicasnmode)_ | DynamicASN detects the AS number to use for the local end of the session<br />without explicitly setting it via the ASN field. Limited to:<br />internal - if the neighbor's ASN is different than the router's the connection is denied.<br />external - if the neighbor's ASN is the same as the router's the connection is denied.<br />ASN and DynamicASN are mutually exclusive and one of them must be specified. | | Enum: [internal external] <br /> |
286286
| `sourceaddress` _string_ | SourceAddress is the IPv4 or IPv6 source address to use for the BGP<br />session to this neighbour, may be specified as either an IP address<br />directly or as an interface name | | |
287287
| `address` _string_ | Address is the IP address to establish the session with. | | |
288+
| `interface` _string_ | Interface is the node interface over which the unnumbered BGP peering will<br />be established. No API validation takes place as that string value<br />represents an interface name on the host and if user provides an invalid<br />value, only the actual BGP session will not be established.<br />Address and Interface are mutually exclusive and one of them must be specified. | | |
288289
| `port` _integer_ | Port is the port to dial when establishing the session.<br />Defaults to 179. | | Maximum: 16384 <br />Minimum: 0 <br /> |
289290
| `password` _string_ | Password to be used for establishing the BGP session.<br />Password and PasswordSecret are mutually exclusive. | | |
290291
| `passwordSecret` _[SecretReference](#secretreference)_ | PasswordSecret is name of the authentication secret for the neighbor.<br />the secret must be of type "kubernetes.io/basic-auth", and created in the<br />same namespace as the frr-k8s daemon. The password is stored in the<br />secret as the key "password".<br />Password and PasswordSecret are mutually exclusive. | | |

api/v1beta1/frrconfiguration_types.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,16 @@ type Neighbor struct {
117117
SourceAddress string `json:"sourceaddress,omitempty"`
118118

119119
// Address is the IP address to establish the session with.
120-
Address string `json:"address"`
120+
// +optional
121+
Address string `json:"address,omitempty"`
122+
123+
// Interface is the node interface over which the unnumbered BGP peering will
124+
// be established. No API validation takes place as that string value
125+
// represents an interface name on the host and if user provides an invalid
126+
// value, only the actual BGP session will not be established.
127+
// Address and Interface are mutually exclusive and one of them must be specified.
128+
// +optional
129+
Interface string `json:"interface,omitempty"`
121130

122131
// Port is the port to dial when establishing the session.
123132
// Defaults to 179.

charts/frr-k8s/charts/crds/templates/frrk8s.metallb.io_frrconfigurations.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ spec:
215215
HoldTime is the requested BGP hold time, per RFC4271.
216216
Defaults to 180s.
217217
type: string
218+
interface:
219+
description: |-
220+
Interface is the node interface over which the unnumbered BGP peering will
221+
be established. No API validation takes place as that string value
222+
represents an interface name on the host and if user provides an invalid
223+
value, only the actual BGP session will not be established.
224+
Address and Interface are mutually exclusive and one of them must be specified.
225+
type: string
218226
keepaliveTime:
219227
description: |-
220228
KeepaliveTime is the requested BGP keepalive time, per RFC4271.
@@ -376,8 +384,6 @@ spec:
376384
type: array
377385
type: object
378386
type: object
379-
required:
380-
- address
381387
type: object
382388
type: array
383389
prefixes:

config/all-in-one/frr-k8s-prometheus.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,14 @@ spec:
230230
HoldTime is the requested BGP hold time, per RFC4271.
231231
Defaults to 180s.
232232
type: string
233+
interface:
234+
description: |-
235+
Interface is the node interface over which the unnumbered BGP peering will
236+
be established. No API validation takes place as that string value
237+
represents an interface name on the host and if user provides an invalid
238+
value, only the actual BGP session will not be established.
239+
Address and Interface are mutually exclusive and one of them must be specified.
240+
type: string
233241
keepaliveTime:
234242
description: |-
235243
KeepaliveTime is the requested BGP keepalive time, per RFC4271.
@@ -391,8 +399,6 @@ spec:
391399
type: array
392400
type: object
393401
type: object
394-
required:
395-
- address
396402
type: object
397403
type: array
398404
prefixes:

config/all-in-one/frr-k8s.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,14 @@ spec:
230230
HoldTime is the requested BGP hold time, per RFC4271.
231231
Defaults to 180s.
232232
type: string
233+
interface:
234+
description: |-
235+
Interface is the node interface over which the unnumbered BGP peering will
236+
be established. No API validation takes place as that string value
237+
represents an interface name on the host and if user provides an invalid
238+
value, only the actual BGP session will not be established.
239+
Address and Interface are mutually exclusive and one of them must be specified.
240+
type: string
233241
keepaliveTime:
234242
description: |-
235243
KeepaliveTime is the requested BGP keepalive time, per RFC4271.
@@ -391,8 +399,6 @@ spec:
391399
type: array
392400
type: object
393401
type: object
394-
required:
395-
- address
396402
type: object
397403
type: array
398404
prefixes:

config/crd/bases/frrk8s.metallb.io_frrconfigurations.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ spec:
215215
HoldTime is the requested BGP hold time, per RFC4271.
216216
Defaults to 180s.
217217
type: string
218+
interface:
219+
description: |-
220+
Interface is the node interface over which the unnumbered BGP peering will
221+
be established. No API validation takes place as that string value
222+
represents an interface name on the host and if user provides an invalid
223+
value, only the actual BGP session will not be established.
224+
Address and Interface are mutually exclusive and one of them must be specified.
225+
type: string
218226
keepaliveTime:
219227
description: |-
220228
KeepaliveTime is the requested BGP keepalive time, per RFC4271.
@@ -376,8 +384,6 @@ spec:
376384
type: array
377385
type: object
378386
type: object
379-
required:
380-
- address
381387
type: object
382388
type: array
383389
prefixes:

e2etests/e2etest_suite_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func handleFlags() {
4747
runOnHost = true
4848
}
4949
dump.ReportPath = reportPath
50+
tests.FRRImage = frrImage
5051
}
5152

5253
func TestMain(m *testing.M) {

e2etests/go.mod

+37-10
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,40 @@ toolchain go1.22.4
66

77
replace (
88
github.com/metallb/frr-k8s => ../
9-
go.universe.tf/e2etest => github.com/metallb/metallb/e2etest v0.0.0-20240715121012-af3c10d65f18
9+
go.universe.tf/e2etest => github.com/metallb/metallb/e2etest v0.0.0-20241212081358-ee34c275145f
1010
go.universe.tf/metallb => github.com/metallb/metallb v0.14.5
1111
)
1212

1313
require (
14-
github.com/metallb/frr-k8s v0.0.11
14+
github.com/google/go-cmp v0.6.0
15+
github.com/metallb/frr-k8s v0.0.16
1516
github.com/onsi/ginkgo/v2 v2.19.0
1617
github.com/onsi/gomega v1.33.1
1718
github.com/openshift-kni/k8sreporter v1.0.4
1819
github.com/prometheus/client_model v0.6.1
1920
github.com/prometheus/common v0.55.0
2021
go.universe.tf/e2etest v0.0.0-00010101000000-000000000000
21-
k8s.io/api v0.31.0
22-
k8s.io/apimachinery v0.31.0
23-
k8s.io/client-go v0.31.0
22+
k8s.io/api v0.31.4
23+
k8s.io/apimachinery v0.31.4
24+
k8s.io/client-go v0.31.1
2425
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
2526
sigs.k8s.io/controller-runtime v0.19.0
2627
)
2728

2829
require (
30+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
31+
github.com/MakeNowJust/heredoc v1.0.0 // indirect
2932
github.com/beorn7/perks v1.0.1 // indirect
33+
github.com/blang/semver/v4 v4.0.0 // indirect
3034
github.com/cespare/xxhash/v2 v2.3.0 // indirect
35+
github.com/chai2010/gettext-go v1.0.2 // indirect
3136
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3237
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
3338
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
39+
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
3440
github.com/fsnotify/fsnotify v1.7.0 // indirect
3541
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
42+
github.com/go-errors/errors v1.4.2 // indirect
3643
github.com/go-logr/logr v1.4.2 // indirect
3744
github.com/go-logr/zapr v1.3.0 // indirect
3845
github.com/go-openapi/jsonpointer v0.21.0 // indirect
@@ -43,46 +50,66 @@ require (
4350
github.com/golang/glog v1.0.0 // indirect
4451
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4552
github.com/golang/protobuf v1.5.4 // indirect
53+
github.com/google/btree v1.0.1 // indirect
4654
github.com/google/gnostic-models v0.6.8 // indirect
47-
github.com/google/go-cmp v0.6.0 // indirect
4855
github.com/google/gofuzz v1.2.0 // indirect
4956
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af // indirect
57+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
5058
github.com/google/uuid v1.6.0 // indirect
59+
github.com/gorilla/websocket v1.5.0 // indirect
60+
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
5161
github.com/imdario/mergo v0.3.16 // indirect
62+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5263
github.com/josharian/intern v1.0.0 // indirect
5364
github.com/json-iterator/go v1.1.12 // indirect
65+
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
5466
github.com/mailru/easyjson v0.7.7 // indirect
67+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
68+
github.com/moby/spdystream v0.4.0 // indirect
69+
github.com/moby/term v0.5.0 // indirect
5570
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5671
github.com/modern-go/reflect2 v1.0.2 // indirect
72+
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
5773
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
74+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
75+
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
5876
github.com/pkg/errors v0.9.1 // indirect
5977
github.com/prometheus/client_golang v1.19.1 // indirect
6078
github.com/prometheus/procfs v0.15.1 // indirect
79+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
80+
github.com/spf13/cobra v1.8.1 // indirect
6181
github.com/spf13/pflag v1.0.5 // indirect
6282
github.com/x448/float16 v0.8.4 // indirect
83+
github.com/xlab/treeprint v1.2.0 // indirect
84+
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
6385
go.uber.org/multierr v1.11.0 // indirect
6486
go.uber.org/zap v1.27.0 // indirect
6587
go.universe.tf/metallb v0.13.7 // indirect
6688
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
6789
golang.org/x/net v0.26.0 // indirect
6890
golang.org/x/oauth2 v0.21.0 // indirect
6991
golang.org/x/sync v0.7.0 // indirect
70-
golang.org/x/sys v0.21.0 // indirect
92+
golang.org/x/sys v0.25.0 // indirect
7193
golang.org/x/term v0.21.0 // indirect
7294
golang.org/x/text v0.16.0 // indirect
7395
golang.org/x/time v0.5.0 // indirect
7496
golang.org/x/tools v0.22.0 // indirect
7597
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
7698
google.golang.org/protobuf v1.34.2 // indirect
99+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
77100
gopkg.in/inf.v0 v0.9.1 // indirect
78101
gopkg.in/yaml.v2 v2.4.0 // indirect
79102
gopkg.in/yaml.v3 v3.0.1 // indirect
80-
k8s.io/apiextensions-apiserver v0.31.0 // indirect
81-
k8s.io/component-base v0.31.0 // indirect
103+
k8s.io/apiextensions-apiserver v0.31.1 // indirect
104+
k8s.io/cli-runtime v0.31.1 // indirect
105+
k8s.io/component-base v0.31.1 // indirect
82106
k8s.io/klog/v2 v2.130.1 // indirect
83107
k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect
84-
k8s.io/pod-security-admission v0.28.4 // indirect
108+
k8s.io/kubectl v0.31.1 // indirect
109+
k8s.io/pod-security-admission v0.31.1 // indirect
85110
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
111+
sigs.k8s.io/kustomize/api v0.17.2 // indirect
112+
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
86113
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
87114
sigs.k8s.io/yaml v1.4.0 // indirect
88115
)

0 commit comments

Comments
 (0)