v1beta2

package
v0.13.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Overview

+groupName=metallb.io

+kubebuilder:object:generate=true +groupName=metallb.io

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger           log.Logger
	WebhookClient    client.Reader
	Validator        validate.ClusterObjects
	MetalLBNamespace string
)

log is for logging addresspool-webhook.

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "metallb.io", Version: "v1beta2"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var GetExistingBGPPeers = func() (*BGPPeerList, error) {
	existingBGPPeerslList := &BGPPeerList{}
	err := WebhookClient.List(context.Background(), existingBGPPeerslList, &client.ListOptions{Namespace: MetalLBNamespace})
	if err != nil {
		return nil, errors.Wrapf(err, "Failed to get existing BGPPeer objects")
	}
	return existingBGPPeerslList, nil
}

Functions

This section is empty.

Types

type BGPPeer

type BGPPeer struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   BGPPeerSpec   `json:"spec,omitempty"`
	Status BGPPeerStatus `json:"status,omitempty"`
}

BGPPeer is the Schema for the peers API.

func (*BGPPeer) DeepCopy

func (in *BGPPeer) DeepCopy() *BGPPeer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BGPPeer.

func (*BGPPeer) DeepCopyInto

func (in *BGPPeer) DeepCopyInto(out *BGPPeer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BGPPeer) DeepCopyObject

func (in *BGPPeer) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*BGPPeer) Hub

func (*BGPPeer) Hub()

Hub marks this type as a conversion hub.

func (*BGPPeer) SetupWebhookWithManager

func (bgpPeer *BGPPeer) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*BGPPeer) ValidateCreate

func (bgpPeer *BGPPeer) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for BGPPeer.

func (*BGPPeer) ValidateDelete

func (bgpPeer *BGPPeer) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for AddressPool.

func (*BGPPeer) ValidateUpdate

func (bgpPeer *BGPPeer) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for AddressPool.

type BGPPeerList

type BGPPeerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BGPPeer `json:"items"`
}

PeerList contains a list of Peer.

func (*BGPPeerList) DeepCopy

func (in *BGPPeerList) DeepCopy() *BGPPeerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BGPPeerList.

func (*BGPPeerList) DeepCopyInto

func (in *BGPPeerList) DeepCopyInto(out *BGPPeerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BGPPeerList) DeepCopyObject

func (in *BGPPeerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type BGPPeerSpec

type BGPPeerSpec struct {
	// AS number to use for the local end of the session.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=4294967295
	MyASN uint32 `json:"myASN"`

	// AS number to expect from the remote end of the session.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=4294967295
	ASN uint32 `json:"peerASN"`

	// Address to dial when establishing the session.
	Address string `json:"peerAddress"`

	// Source address to use when establishing the session.
	// +optional
	SrcAddress string `json:"sourceAddress,omitempty"`

	// Port to dial when establishing the session.
	// +optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=16384
	// +kubebuilder:default:=179
	Port uint16 `json:"peerPort,omitempty"`

	// Requested BGP hold time, per RFC4271.
	// +optional
	HoldTime metav1.Duration `json:"holdTime,omitempty"`

	// Requested BGP keepalive time, per RFC4271.
	// +optional
	KeepaliveTime metav1.Duration `json:"keepaliveTime,omitempty"`

	// BGP router ID to advertise to the peer
	// +optional
	RouterID string `json:"routerID,omitempty"`

	// Only connect to this peer on nodes that match one of these
	// selectors.
	// +optional
	NodeSelectors []metav1.LabelSelector `json:"nodeSelectors,omitempty"`

	// Authentication password for routers enforcing TCP MD5 authenticated sessions
	// +optional
	Password string `json:"password,omitempty"`

	// passwordSecret is name of the authentication secret for BGP Peer.
	// the secret must be of type "kubernetes.io/basic-auth", and created in the
	// same namespace as the MetalLB deployment. The password is stored in the
	// secret as the key "password".
	// +optional
	PasswordSecret v1.SecretReference `json:"passwordSecret,omitempty"`

	// The name of the BFD Profile to be used for the BFD session associated to the BGP session. If not set, the BFD session won't be set up.
	// +optional
	BFDProfile string `json:"bfdProfile,omitempty"`

	// To set if the BGPPeer is multi-hops away. Needed for FRR mode only.
	// +optional
	EBGPMultiHop bool `json:"ebgpMultiHop,omitempty"`
}

BGPPeerSpec defines the desired state of Peer.

func (*BGPPeerSpec) DeepCopy

func (in *BGPPeerSpec) DeepCopy() *BGPPeerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BGPPeerSpec.

func (*BGPPeerSpec) DeepCopyInto

func (in *BGPPeerSpec) DeepCopyInto(out *BGPPeerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BGPPeerStatus

type BGPPeerStatus struct {
}

BGPPeerStatus defines the observed state of Peer.

func (*BGPPeerStatus) DeepCopy

func (in *BGPPeerStatus) DeepCopy() *BGPPeerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BGPPeerStatus.

func (*BGPPeerStatus) DeepCopyInto

func (in *BGPPeerStatus) DeepCopyInto(out *BGPPeerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL