Skip to content

Commit

Permalink
Merge pull request #212 from karampok/unnumbered
Browse files Browse the repository at this point in the history
Support unnumbered BGP peering
  • Loading branch information
fedepaol authored Dec 17, 2024
2 parents 55ce611 + 79f4f21 commit 80d4b7a
Show file tree
Hide file tree
Showing 25 changed files with 999 additions and 1,357 deletions.
1 change: 1 addition & 0 deletions API-DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ _Appears in:_
| `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 /> |
| `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 | | |
| `address` _string_ | Address is the IP address to establish the session with. | | |
| `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. | | |
| `port` _integer_ | Port is the port to dial when establishing the session.<br />Defaults to 179. | | Maximum: 16384 <br />Minimum: 0 <br /> |
| `password` _string_ | Password to be used for establishing the BGP session.<br />Password and PasswordSecret are mutually exclusive. | | |
| `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. | | |
Expand Down
11 changes: 10 additions & 1 deletion api/v1beta1/frrconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,16 @@ type Neighbor struct {
SourceAddress string `json:"sourceaddress,omitempty"`

// Address is the IP address to establish the session with.
Address string `json:"address"`
// +optional
Address string `json:"address,omitempty"`

// Interface is the node interface over which the unnumbered BGP peering will
// be established. No API validation takes place as that string value
// represents an interface name on the host and if user provides an invalid
// value, only the actual BGP session will not be established.
// Address and Interface are mutually exclusive and one of them must be specified.
// +optional
Interface string `json:"interface,omitempty"`

// Port is the port to dial when establishing the session.
// Defaults to 179.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ spec:
HoldTime is the requested BGP hold time, per RFC4271.
Defaults to 180s.
type: string
interface:
description: |-
Interface is the node interface over which the unnumbered BGP peering will
be established. No API validation takes place as that string value
represents an interface name on the host and if user provides an invalid
value, only the actual BGP session will not be established.
Address and Interface are mutually exclusive and one of them must be specified.
type: string
keepaliveTime:
description: |-
KeepaliveTime is the requested BGP keepalive time, per RFC4271.
Expand Down Expand Up @@ -376,8 +384,6 @@ spec:
type: array
type: object
type: object
required:
- address
type: object
type: array
prefixes:
Expand Down
10 changes: 8 additions & 2 deletions config/all-in-one/frr-k8s-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ spec:
HoldTime is the requested BGP hold time, per RFC4271.
Defaults to 180s.
type: string
interface:
description: |-
Interface is the node interface over which the unnumbered BGP peering will
be established. No API validation takes place as that string value
represents an interface name on the host and if user provides an invalid
value, only the actual BGP session will not be established.
Address and Interface are mutually exclusive and one of them must be specified.
type: string
keepaliveTime:
description: |-
KeepaliveTime is the requested BGP keepalive time, per RFC4271.
Expand Down Expand Up @@ -391,8 +399,6 @@ spec:
type: array
type: object
type: object
required:
- address
type: object
type: array
prefixes:
Expand Down
10 changes: 8 additions & 2 deletions config/all-in-one/frr-k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ spec:
HoldTime is the requested BGP hold time, per RFC4271.
Defaults to 180s.
type: string
interface:
description: |-
Interface is the node interface over which the unnumbered BGP peering will
be established. No API validation takes place as that string value
represents an interface name on the host and if user provides an invalid
value, only the actual BGP session will not be established.
Address and Interface are mutually exclusive and one of them must be specified.
type: string
keepaliveTime:
description: |-
KeepaliveTime is the requested BGP keepalive time, per RFC4271.
Expand Down Expand Up @@ -391,8 +399,6 @@ spec:
type: array
type: object
type: object
required:
- address
type: object
type: array
prefixes:
Expand Down
10 changes: 8 additions & 2 deletions config/crd/bases/frrk8s.metallb.io_frrconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ spec:
HoldTime is the requested BGP hold time, per RFC4271.
Defaults to 180s.
type: string
interface:
description: |-
Interface is the node interface over which the unnumbered BGP peering will
be established. No API validation takes place as that string value
represents an interface name on the host and if user provides an invalid
value, only the actual BGP session will not be established.
Address and Interface are mutually exclusive and one of them must be specified.
type: string
keepaliveTime:
description: |-
KeepaliveTime is the requested BGP keepalive time, per RFC4271.
Expand Down Expand Up @@ -376,8 +384,6 @@ spec:
type: array
type: object
type: object
required:
- address
type: object
type: array
prefixes:
Expand Down
1 change: 1 addition & 0 deletions e2etests/e2etest_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func handleFlags() {
runOnHost = true
}
dump.ReportPath = reportPath
tests.FRRImage = frrImage
}

func TestMain(m *testing.M) {
Expand Down
47 changes: 37 additions & 10 deletions e2etests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,40 @@ toolchain go1.22.4

replace (
github.com/metallb/frr-k8s => ../
go.universe.tf/e2etest => github.com/metallb/metallb/e2etest v0.0.0-20240715121012-af3c10d65f18
go.universe.tf/e2etest => github.com/metallb/metallb/e2etest v0.0.0-20241212081358-ee34c275145f
go.universe.tf/metallb => github.com/metallb/metallb v0.14.5
)

require (
github.com/metallb/frr-k8s v0.0.11
github.com/google/go-cmp v0.6.0
github.com/metallb/frr-k8s v0.0.16
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/openshift-kni/k8sreporter v1.0.4
github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.55.0
go.universe.tf/e2etest v0.0.0-00010101000000-000000000000
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
k8s.io/api v0.31.4
k8s.io/apimachinery v0.31.4
k8s.io/client-go v0.31.1
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
sigs.k8s.io/controller-runtime v0.19.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
Expand All @@ -43,46 +50,66 @@ require (
github.com/golang/glog v1.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/moby/spdystream v0.4.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.universe.tf/metallb v0.13.7 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.22.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.31.0 // indirect
k8s.io/component-base v0.31.0 // indirect
k8s.io/apiextensions-apiserver v0.31.1 // indirect
k8s.io/cli-runtime v0.31.1 // indirect
k8s.io/component-base v0.31.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect
k8s.io/pod-security-admission v0.28.4 // indirect
k8s.io/kubectl v0.31.1 // indirect
k8s.io/pod-security-admission v0.31.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.17.2 // indirect
sigs.k8s.io/kustomize/kyaml v0.17.1 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit 80d4b7a

Please sign in to comment.