Skip to content

Commit

Permalink
k8s: introducing BGPv2 CRDs
Browse files Browse the repository at this point in the history
Introducing new BGP CRDs to enable more flexible way to configure BGP in
Cilium cluster.

- CiliumBGPClusterConfig
- CiliumBGPAdvertisement
- CiliumBGPPeerConfig
- CiliumBGPNodeConfig
- CiliumBGPNodeOverrideConfig

Pleasa refer to CFP https://isogo.to/bgpv2-crds for more details.

Signed-off-by: harsimran pabla <hpabla@isovalent.com>
  • Loading branch information
harsimran-pabla authored and joestringer committed Oct 16, 2023
1 parent 379e2be commit ce02445
Show file tree
Hide file tree
Showing 48 changed files with 5,924 additions and 139 deletions.
5 changes: 5 additions & 0 deletions Documentation/crdlist.rst

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

5 changes: 5 additions & 0 deletions Makefile
Expand Up @@ -233,6 +233,11 @@ CRDS_CILIUM_V2 := ciliumnetworkpolicies \
ciliumclusterwideenvoyconfigs
CRDS_CILIUM_V2ALPHA1 := ciliumendpointslices \
ciliumbgppeeringpolicies \
ciliumbgpclusterconfigs \
ciliumbgppeerconfigs \
ciliumbgpadvertisements \
ciliumbgpnodeconfigs \
ciliumbgpnodeconfigoverrides \
ciliumloadbalancerippools \
ciliumnodeconfigs \
ciliumcidrgroups \
Expand Down
34 changes: 34 additions & 0 deletions install/kubernetes/cilium/Chart.yaml
Expand Up @@ -111,6 +111,40 @@ annotations:
description: |
Cilium BGP Peering Policy instructs Cilium to create specific BGP peering
configurations.
- kind: CiliumBGPClusterConfig
version: v2alpha1
name: ciliumbgpclusterconfigs.cilium.io
displayName: Cilium BGP Cluster Config
description: |
Cilium BGP Cluster Config instructs Cilium operator to create specific BGP cluster
configurations.
- kind: CiliumBGPPeerConfig
version: v2alpha1
name: ciliumbgppeerconfigs.cilium.io
displayName: Cilium BGP Peer Config
description: |
CiliumBGPPeerConfig is a common set of BGP peer configurations. It can be referenced
by multiple peers from CiliumBGPClusterConfig.
- kind: CiliumBGPAdvertisement
version: v2alpha1
name: ciliumbgpadvertisements.cilium.io
displayName: Cilium BGP Advertisement
description: |
CiliumBGPAdvertisement is used to define source of BGP advertisement as well as BGP attributes
to be advertised with those prefixes.
- kind: CiliumBGPNodeConfig
version: v2alpha1
name: ciliumbgpnodeconfigs.cilium.io
displayName: Cilium BGP Node Config
description: |
CiliumBGPNodeConfig is read only node specific BGP configuration. It is constructed by Cilium operator.
It will also contain node local BGP state information.
- kind: CiliumBGPNodeConfigOverride
version: v2alpha1
name: ciliumbgpnodeconfigoverrides.cilium.io
displayName: Cilium BGP Node Config Override
description: |
CiliumBGPNodeConfigOverride can be used to override node specific BGP configuration.
- kind: CiliumLoadBalancerIPPool
version: v2alpha1
name: ciliumloadbalancerippools.cilium.io
Expand Down
Expand Up @@ -86,6 +86,9 @@ rules:
resources:
- ciliumloadbalancerippools
- ciliumbgppeeringpolicies
- ciliumbgpnodeconfigs
- ciliumbgpadvertisements
- ciliumbgppeerconfigs
- ciliumclusterwideenvoyconfigs
- ciliumclusterwidenetworkpolicies
- ciliumegressgatewaypolicies
Expand Down Expand Up @@ -141,6 +144,7 @@ rules:
- ciliumendpoints/status
- ciliumendpoints
- ciliuml2announcementpolicies/status
- ciliumbgpnodeconfigs/status
verbs:
- patch
{{- end }}
Expand Up @@ -161,6 +161,9 @@ rules:
resources:
- ciliumendpointslices
- ciliumenvoyconfigs
- ciliumbgppeerconfigs
- ciliumbgpadvertisements
- ciliumbgpnodeconfigs
verbs:
- create
- update
Expand All @@ -187,6 +190,11 @@ rules:
resourceNames:
- ciliumloadbalancerippools.cilium.io
- ciliumbgppeeringpolicies.cilium.io
- ciliumbgpclusterconfigs.cilium.io
- ciliumbgppeerconfigs.cilium.io
- ciliumbgpadvertisements.cilium.io
- ciliumbgpnodeconfigs.cilium.io
- ciliumbgpnodeconfigoverrides.cilium.io
- ciliumclusterwideenvoyconfigs.cilium.io
- ciliumclusterwidenetworkpolicies.cilium.io
- ciliumegressgatewaypolicies.cilium.io
Expand All @@ -207,6 +215,8 @@ rules:
resources:
- ciliumloadbalancerippools
- ciliumpodippools
- ciliumbgpclusterconfigs
- ciliumbgpnodeconfigoverrides
verbs:
- get
- list
Expand Down
Expand Up @@ -86,6 +86,9 @@ rules:
resources:
- ciliumloadbalancerippools
- ciliumbgppeeringpolicies
- ciliumbgpnodeconfigs
- ciliumbgpadvertisements
- ciliumbgppeerconfigs
- ciliumclusterwideenvoyconfigs
- ciliumclusterwidenetworkpolicies
- ciliumegressgatewaypolicies
Expand Down Expand Up @@ -141,6 +144,7 @@ rules:
- ciliumendpoints/status
- ciliumendpoints
- ciliuml2announcementpolicies/status
- ciliumbgpnodeconfigs/status
verbs:
- patch
{{- end }}
@@ -0,0 +1,176 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
creationTimestamp: null
name: ciliumbgpadvertisements.cilium.io
spec:
group: cilium.io
names:
categories:
- cilium
- ciliumbgp
kind: CiliumBGPAdvertisement
listKind: CiliumBGPAdvertisementList
plural: ciliumbgpadvertisements
shortNames:
- cbgpadvert
singular: ciliumbgpadvertisement
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v2alpha1
schema:
openAPIV3Schema:
description: CiliumBGPAdvertisement is the Schema for the ciliumbgpadvertisements
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
advertisements:
description: Advertisements is a list of BGP advertisements.
items:
description: Advertisement defines which routes Cilium should advertise
to BGP peers. Optionally, additional attributes can be set to
the advertised routes.
properties:
advertisementType:
description: AdvertisementType defines type of advertisement
which has to be advertised.
enum:
- PodCIDR
- CiliumPodIPPool
- CiliumLoadBalancerIP
type: string
attributes:
description: Attributes defines additional attributes to set
to the advertised routes. If not specified, no additional
attributes are set.
properties:
community:
description: Community sets the community attribute in the
route. If not specified, no community attribute is set.
properties:
large:
description: Large holds a list of the BGP Large Communities
Attribute (RFC 8092) values.
items:
description: BGPLargeCommunity type represents a value
of the BGP Large Communities Attribute (RFC 8092),
as three 4-byte decimal numbers separated by colons.
pattern: ^([0-9]|[1-9][0-9]{1,8}|[1-3][0-9]{9}|4[01][0-9]{8}|42[0-8][0-9]{7}|429[0-3][0-9]{6}|4294[0-8][0-9]{5}|42949[0-5][0-9]{4}|429496[0-6][0-9]{3}|4294967[01][0-9]{2}|42949672[0-8][0-9]|429496729[0-5]):([0-9]|[1-9][0-9]{1,8}|[1-3][0-9]{9}|4[01][0-9]{8}|42[0-8][0-9]{7}|429[0-3][0-9]{6}|4294[0-8][0-9]{5}|42949[0-5][0-9]{4}|429496[0-6][0-9]{3}|4294967[01][0-9]{2}|42949672[0-8][0-9]|429496729[0-5]):([0-9]|[1-9][0-9]{1,8}|[1-3][0-9]{9}|4[01][0-9]{8}|42[0-8][0-9]{7}|429[0-3][0-9]{6}|4294[0-8][0-9]{5}|42949[0-5][0-9]{4}|429496[0-6][0-9]{3}|4294967[01][0-9]{2}|42949672[0-8][0-9]|429496729[0-5])$
type: string
type: array
standard:
description: Standard holds a list of "standard" 32-bit
BGP Communities Attribute (RFC 1997) values.
items:
description: BGPStandardCommunity type represents
a value of the "standard" 32-bit BGP Communities
Attribute (RFC 1997) as a 4-byte decimal number
or two 2-byte decimal numbers separated by a colon.
pattern: ^([0-9]|[1-9][0-9]{1,8}|[1-3][0-9]{9}|4[01][0-9]{8}|42[0-8][0-9]{7}|429[0-3][0-9]{6}|4294[0-8][0-9]{5}|42949[0-5][0-9]{4}|429496[0-6][0-9]{3}|4294967[01][0-9]{2}|42949672[0-8][0-9]|429496729[0-5])$|^([0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]):([0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$
type: string
type: array
type: object
localPreference:
description: LocalPreference sets the local preference attribute
in the route. If not specified, no local preference attribute
is set.
format: int64
type: integer
type: object
selector:
description: Selector is a label selector to select objects
of the type specified by AdvertisementType. If not specified,
all objects of the type specified by AdvertisementType are
selected for advertisement.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
enum:
- In
- NotIn
- Exists
- DoesNotExist
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists or
DoesNotExist, the values array must be empty. This
array is replaced during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
description: MatchLabelsValue represents the value from
the MatchLabels {key,value} pair.
maxLength: 63
pattern: ^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is
"key", the operator is "In", and the values array contains
only "value". The requirements are ANDed.
type: object
type: object
required:
- advertisementType
type: object
minItems: 1
type: array
required:
- advertisements
type: object
required:
- metadata
- spec
type: object
served: true
storage: true
subresources: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

0 comments on commit ce02445

Please sign in to comment.