Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BGP confederation support in BGPPolicy #6905

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions build/charts/antrea/crds/bgppolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ spec:
minimum: 1
maximum: 65535
default: 179
confederation:
type: object
properties:
enable:
type: boolean
default: false
identifier:
type: integer
format: int32
Comment on lines +64 to +66
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the range of valid values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The range should be 1-4294967295 if we can merge #6914

peers:
type: array
items:
type: integer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a minimum and maximum value here like for asn (and also we are missing format)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, will update.

advertisements:
type: object
properties:
Expand Down
13 changes: 13 additions & 0 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,19 @@ spec:
minimum: 1
maximum: 65535
default: 179
confederation:
type: object
properties:
enable:
type: boolean
default: false
identifier:
type: integer
format: int32
peers:
type: array
items:
type: integer
advertisements:
type: object
properties:
Expand Down
13 changes: 13 additions & 0 deletions build/yamls/antrea-crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,19 @@ spec:
minimum: 1
maximum: 65535
default: 179
confederation:
type: object
properties:
enable:
type: boolean
default: false
identifier:
type: integer
format: int32
peers:
type: array
items:
type: integer
advertisements:
type: object
properties:
Expand Down
13 changes: 13 additions & 0 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,19 @@ spec:
minimum: 1
maximum: 65535
default: 179
confederation:
type: object
properties:
enable:
type: boolean
default: false
identifier:
type: integer
format: int32
peers:
type: array
items:
type: integer
advertisements:
type: object
properties:
Expand Down
13 changes: 13 additions & 0 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,19 @@ spec:
minimum: 1
maximum: 65535
default: 179
confederation:
type: object
properties:
enable:
type: boolean
default: false
identifier:
type: integer
format: int32
peers:
type: array
items:
type: integer
advertisements:
type: object
properties:
Expand Down
13 changes: 13 additions & 0 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,19 @@ spec:
minimum: 1
maximum: 65535
default: 179
confederation:
type: object
properties:
enable:
type: boolean
default: false
identifier:
type: integer
format: int32
peers:
type: array
items:
type: integer
advertisements:
type: object
properties:
Expand Down
13 changes: 13 additions & 0 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,19 @@ spec:
minimum: 1
maximum: 65535
default: 179
confederation:
type: object
properties:
enable:
type: boolean
default: false
identifier:
type: integer
format: int32
peers:
type: array
items:
type: integer
advertisements:
type: object
properties:
Expand Down
14 changes: 14 additions & 0 deletions pkg/apis/crd/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ type BGPPolicySpec struct {
// ListenPort is the port on which the BGP process listens, and the default value is 179.
ListenPort *int32 `json:"listenPort,omitempty"`

// Confederation specifies BGP confederation configuration.
Confederation Confederation `json:"confederation"`

// Advertisements configures IPs or CIDRs to be advertised to BGP peers.
Advertisements Advertisements `json:"advertisements,omitempty"`

Expand All @@ -289,6 +292,17 @@ type Advertisements struct {
Egress *EgressAdvertisement `json:"egress,omitempty"`
}

type Confederation struct {
// Enabled indicates whether BGP confederation is enabled.
Enabled bool `json:"enabled,omitempty"`
Comment on lines +296 to +297
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need an "enabled" field or should the confederation field be a pointer / optional in BGPPolicySpec?


// Identifier specifies the confederation's ASN.
Identifier int32 `json:"identifier,omitempty"`

// Peers lists the ASNs of other members in the confederation.
Peers []int32 `json:"peers,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the term "members" is typically used for BGP confederation. Should we name this field MemberASNs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I selected the term "peers" because it is used by the commands of some well-known vendors like Cisco. For example:

router bgp 65000
  bgp confederation identifier 65000
  bgp confederation peers 65001 65002
  neighbor 192.168.1.1 remote-as 65001
  neighbor 192.168.2.1 remote-as 65002

The term "peers" is not very readable. I'm fine with MemberASN, and it is more readable.

}

type ServiceIPType string

const (
Expand Down
22 changes: 22 additions & 0 deletions pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading