v1alpha1

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 26 Imported by: 6

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API.

Package v1alpha1 contains API Schema definitions for the ipam v1alpha1 API group +kubebuilder:object:generate=true +groupName=ipam.metal.ironcore.dev

Index

Constants

View Source
const (
	CIPv6SubnetType SubnetAddressType = "IPv6"
	CIPv4SubnetType SubnetAddressType = "IPv4"

	CLocalSubnetLocalityType         SubnetLocalityType = "Local"
	CRegionalSubnetLocalityType      SubnetLocalityType = "Regional"
	CMultiregionalSubnetLocalityType SubnetLocalityType = "Multiregional"

	CFailedSubnetState     SubnetState = "Failed"
	CProcessingSubnetState SubnetState = "Processing"
	CFinishedSubnetState   SubnetState = "Finished"
)
View Source
const (
	CFinishedChildSubnetToSubnetIndexKey = "finishedChildSubnetToSubnet"
	CFinishedChildIPToSubnetIndexKey     = "finishedChildIPToSubnet"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "ipam.metal.ironcore.dev", Version: "v1alpha1"}

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

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var CGENEVEFirstAvaliableID = CVXLANFirstAvaliableID
View Source
var CGENEVEMaxID = CVXLANMaxID
View Source
var CIncrement = big.NewInt(1)
View Source
var CMPLSFirstAvailableID = NetworkIDFromBytes([]byte{15 + 1})

First 16 addresses (0-15) are reserved

View Source
var CVXLANFirstAvaliableID = NetworkIDFromBytes([]byte{99 + 1})

First 100 addresses (0-99) are reserved

View Source
var CVXLANMaxID = NetworkIDFromBytes([]byte{255, 255, 255})

Functions

func FindParentNetworkIdx

func FindParentNetworkIdx(ranges []CIDR, cidr *CIDR, left int, right int) (int, error)

func Resource

func Resource(resource string) schema.GroupResource

Types

type CIDR

type CIDR struct {
	Net netip.Prefix `json:"-"`
}

+kubebuilder:validation:Type=string

func CIDRFromNet

func CIDRFromNet(n netip.Prefix) *CIDR

func CIDRFromString

func CIDRFromString(cidrString string) (*CIDR, error)

func (*CIDR) AddressCapacity

func (in *CIDR) AddressCapacity() *big.Int

func (*CIDR) After

func (in *CIDR) After(cidr *CIDR) bool

func (*CIDR) AsIPAddr

func (in *CIDR) AsIPAddr() *IPAddr

func (*CIDR) Before

func (in *CIDR) Before(cidr *CIDR) bool

func (*CIDR) CanJoin

func (in *CIDR) CanJoin(cidr *CIDR) bool

func (*CIDR) CanReserve

func (in *CIDR) CanReserve(cidr *CIDR) bool

func (*CIDR) DeepCopy

func (in *CIDR) DeepCopy() *CIDR

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

func (*CIDR) DeepCopyInto

func (in *CIDR) DeepCopyInto(out *CIDR)

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

func (*CIDR) Equal

func (in *CIDR) Equal(cidr *CIDR) bool

func (*CIDR) IsIPv4

func (in *CIDR) IsIPv4() bool

func (*CIDR) IsIPv6

func (in *CIDR) IsIPv6() bool

func (*CIDR) IsLeft

func (in *CIDR) IsLeft() bool

func (*CIDR) IsRight

func (in *CIDR) IsRight() bool

func (*CIDR) Join

func (in *CIDR) Join(cidr *CIDR)

func (*CIDR) MarshalJSON

func (in *CIDR) MarshalJSON() ([]byte, error)

func (*CIDR) MaskBits

func (in *CIDR) MaskBits() byte

func (*CIDR) MaskCapacity

func (in *CIDR) MaskCapacity() *big.Int

func (*CIDR) MaskOnes

func (in *CIDR) MaskOnes() byte

func (*CIDR) MaskZeroes

func (in *CIDR) MaskZeroes() byte

func (*CIDR) Reserve

func (in *CIDR) Reserve(cidr *CIDR) []CIDR

func (*CIDR) String

func (in *CIDR) String() string

func (*CIDR) ToAddressRange

func (in *CIDR) ToAddressRange() (netip.Addr, netip.Addr)

func (*CIDR) UnmarshalJSON

func (in *CIDR) UnmarshalJSON(b []byte) error

type IP

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

	Spec   IPSpec   `json:"spec,omitempty"`
	Status IPStatus `json:"status,omitempty"`
}

IP is the Schema for the ips API

func (*IP) DeepCopy

func (in *IP) DeepCopy() *IP

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

func (*IP) DeepCopyInto

func (in *IP) DeepCopyInto(out *IP)

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

func (*IP) DeepCopyObject

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

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

func (*IP) SetupWebhookWithManager

func (in *IP) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*IP) ValidateCreate

func (in *IP) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*IP) ValidateDelete

func (in *IP) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*IP) ValidateUpdate

func (in *IP) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type IPAddr

type IPAddr struct {
	Net netip.Addr `json:"-"`
}

+kubebuilder:validation:Type=string

func IPAddrFromString

func IPAddrFromString(ipString string) (*IPAddr, error)

func (*IPAddr) AsCidr

func (in *IPAddr) AsCidr() *CIDR

func (*IPAddr) DeepCopy

func (in *IPAddr) DeepCopy() *IPAddr

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

func (*IPAddr) DeepCopyInto

func (in *IPAddr) DeepCopyInto(out *IPAddr)

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

func (*IPAddr) Equal

func (in *IPAddr) Equal(other *IPAddr) bool

func (IPAddr) MarshalJSON

func (in IPAddr) MarshalJSON() ([]byte, error)

func (IPAddr) OpenAPISchemaFormat added in v0.2.1

func (_ IPAddr) OpenAPISchemaFormat() string

OpenAPISchemaFormat is used by the kube-openapi generator when constructing the OpenAPI spec of this type.

func (IPAddr) OpenAPISchemaType added in v0.2.1

func (_ IPAddr) OpenAPISchemaType() []string

OpenAPISchemaType is used by the kube-openapi generator when constructing the OpenAPI spec of this type.

func (*IPAddr) String

func (in *IPAddr) String() string

func (*IPAddr) UnmarshalJSON

func (in *IPAddr) UnmarshalJSON(b []byte) error

type IPList

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

IPList contains a list of IP +kubebuilder:object:root=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*IPList) DeepCopy

func (in *IPList) DeepCopy() *IPList

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

func (*IPList) DeepCopyInto

func (in *IPList) DeepCopyInto(out *IPList)

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

func (*IPList) DeepCopyObject

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

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

type IPSpec

type IPSpec struct {
	// SubnetName is referring to parent subnet that holds requested IP
	// +kubebuilder:validation:Required
	Subnet v1.LocalObjectReference `json:"subnet"`
	// Consumer refers to resource IP has been booked for
	// +kubebuilder:validation:Optional
	Consumer *ResourceReference `json:"consumer,omitempty"`
	// IP allows to set desired IP address explicitly
	// +kubebuilder:validation:Optional
	IP *IPAddr `json:"ip,omitempty"`
}

IPSpec defines the desired state of IP

func (*IPSpec) DeepCopy

func (in *IPSpec) DeepCopy() *IPSpec

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

func (*IPSpec) DeepCopyInto

func (in *IPSpec) DeepCopyInto(out *IPSpec)

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

type IPState

type IPState string

IPState is a processing state of IP resource

const (
	CFailedIPState     IPState = "Failed"
	CProcessingIPState IPState = "Processing"
	CFinishedIPState   IPState = "Finished"
)

type IPStatus

type IPStatus struct {
	// State is a network creation request processing state
	State IPState `json:"state,omitempty"`
	// Reserved is a reserved IP
	Reserved *IPAddr `json:"reserved,omitempty"`
	// Message contains error details if the one has occurred
	Message string `json:"message,omitempty"`
}

IPStatus defines the observed state of IP

func (*IPStatus) DeepCopy

func (in *IPStatus) DeepCopy() *IPStatus

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

func (*IPStatus) DeepCopyInto

func (in *IPStatus) DeepCopyInto(out *IPStatus)

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

type Network

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

	Spec   NetworkSpec   `json:"spec,omitempty"`
	Status NetworkStatus `json:"status,omitempty"`
}

Network is the Schema for the networks API +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`,description="Network Type" +kubebuilder:printcolumn:name="Reserved",type=string,JSONPath=`.status.reserved`,description="Reserved Network ID" +kubebuilder:printcolumn:name="IPv4 Capacity",type=string,JSONPath=`.status.ipv4Capacity`,description="Total IPv4 address capacity in all ranges" +kubebuilder:printcolumn:name="IPv6 Capacity",type=string,JSONPath=`.status.ipv6Capacity`,description="Total IPv4 address capacity in all ranges" +kubebuilder:printcolumn:name="Description",type=string,JSONPath=`.spec.description`,description="Description" +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`,description="Request state" +kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.message`,description="Message about request processing resutls" +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +genclient

func (*Network) CanRelease

func (in *Network) CanRelease(cidr *CIDR) bool

func (*Network) CanReserve

func (in *Network) CanReserve(cidr *CIDR) bool

func (*Network) DeepCopy

func (in *Network) DeepCopy() *Network

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

func (*Network) DeepCopyInto

func (in *Network) DeepCopyInto(out *Network)

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

func (*Network) DeepCopyObject

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

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

func (*Network) Release

func (in *Network) Release(cidr *CIDR) error

func (*Network) Reserve

func (in *Network) Reserve(cidr *CIDR) error

func (*Network) SetupWebhookWithManager

func (in *Network) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Network) ValidateCreate

func (in *Network) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Network) ValidateDelete

func (in *Network) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Network) ValidateUpdate

func (in *Network) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type NetworkCounter

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

	Spec   NetworkCounterSpec   `json:"spec,omitempty"`
	Status NetworkCounterStatus `json:"status,omitempty"`
}

NetworkCounter is the Schema for the networkcounters API

func (*NetworkCounter) DeepCopy

func (in *NetworkCounter) DeepCopy() *NetworkCounter

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

func (*NetworkCounter) DeepCopyInto

func (in *NetworkCounter) DeepCopyInto(out *NetworkCounter)

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

func (*NetworkCounter) DeepCopyObject

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

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

func (*NetworkCounter) SetupWebhookWithManager

func (in *NetworkCounter) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*NetworkCounter) ValidateCreate

func (in *NetworkCounter) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*NetworkCounter) ValidateDelete

func (in *NetworkCounter) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*NetworkCounter) ValidateUpdate

func (in *NetworkCounter) ValidateUpdate(_ runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type NetworkCounterList

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

NetworkCounterList contains a list of NetworkCounter

func (*NetworkCounterList) DeepCopy

func (in *NetworkCounterList) DeepCopy() *NetworkCounterList

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

func (*NetworkCounterList) DeepCopyInto

func (in *NetworkCounterList) DeepCopyInto(out *NetworkCounterList)

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

func (*NetworkCounterList) DeepCopyObject

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

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

type NetworkCounterSpec

type NetworkCounterSpec struct {
	// Vacant is a list of unassigned network IDs.
	Vacant []NetworkIDInterval `json:"vacant,omitempty"`
}

NetworkCounterSpec stores the state of assigned IDs for network type.

func NewNetworkCounterSpec

func NewNetworkCounterSpec(typ NetworkType) *NetworkCounterSpec

func (*NetworkCounterSpec) CanReserve

func (in *NetworkCounterSpec) CanReserve(id *NetworkID) bool

func (*NetworkCounterSpec) DeepCopy

func (in *NetworkCounterSpec) DeepCopy() *NetworkCounterSpec

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

func (*NetworkCounterSpec) DeepCopyInto

func (in *NetworkCounterSpec) DeepCopyInto(out *NetworkCounterSpec)

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

func (*NetworkCounterSpec) Propose

func (in *NetworkCounterSpec) Propose() (*NetworkID, error)

func (*NetworkCounterSpec) Release

func (in *NetworkCounterSpec) Release(id *NetworkID) error

func (*NetworkCounterSpec) Reserve

func (in *NetworkCounterSpec) Reserve(id *NetworkID) error

type NetworkCounterStatus

type NetworkCounterStatus struct {
}

NetworkCounterStatus defines the observed state of NetworkCounter

func (*NetworkCounterStatus) DeepCopy

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

func (*NetworkCounterStatus) DeepCopyInto

func (in *NetworkCounterStatus) DeepCopyInto(out *NetworkCounterStatus)

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

type NetworkID

type NetworkID struct {
	big.Int `json:"-"`
}

NetworkID represents an incremental ID for network type. Effectively it is a wrapper around big.Int, as its Bytes() method allows to get unsigned big endian representation for the value.

func NetworkIDFromBigInt

func NetworkIDFromBigInt(bi *big.Int) *NetworkID

func NetworkIDFromBytes

func NetworkIDFromBytes(b []byte) *NetworkID

func NetworkIDFromInt64

func NetworkIDFromInt64(i64 int64) *NetworkID

func (*NetworkID) DeepCopy

func (in *NetworkID) DeepCopy() *NetworkID

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

func (*NetworkID) DeepCopyInto

func (in *NetworkID) DeepCopyInto(out *NetworkID)

func (*NetworkID) Eq

func (in *NetworkID) Eq(r *NetworkID) bool

func (NetworkID) MarshalJSON

func (in NetworkID) MarshalJSON() ([]byte, error)

func (*NetworkID) UnmarshalJSON

func (in *NetworkID) UnmarshalJSON(b []byte) error

type NetworkIDInterval

type NetworkIDInterval struct {
	// Begin is a first available value in interval
	Begin *NetworkID `json:"begin,omitempty"`
	// Exact represents a single value in interval
	Exact *NetworkID `json:"exact,omitempty"`
	// End is a last available value in interval
	End *NetworkID `json:"end,omitempty"`
}

NetworkIDInterval represents inclusive interval for network IDs. Used to represent intervals of unassigned IDs.

func (*NetworkIDInterval) After

func (in *NetworkIDInterval) After(id *NetworkID) bool

func (*NetworkIDInterval) Before

func (in *NetworkIDInterval) Before(id *NetworkID) bool

func (*NetworkIDInterval) CanJoinLeft

func (in *NetworkIDInterval) CanJoinLeft(id *NetworkID) bool

func (*NetworkIDInterval) CanJoinRight

func (in *NetworkIDInterval) CanJoinRight(id *NetworkID) bool

func (*NetworkIDInterval) DeepCopy

func (in *NetworkIDInterval) DeepCopy() *NetworkIDInterval

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

func (*NetworkIDInterval) DeepCopyInto

func (in *NetworkIDInterval) DeepCopyInto(out *NetworkIDInterval)

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

func (*NetworkIDInterval) Includes

func (in *NetworkIDInterval) Includes(id *NetworkID) bool

func (*NetworkIDInterval) JoinLeft

func (in *NetworkIDInterval) JoinLeft(id *NetworkID) bool

func (*NetworkIDInterval) JoinRight

func (in *NetworkIDInterval) JoinRight(id *NetworkID) bool

func (*NetworkIDInterval) Propose

func (in *NetworkIDInterval) Propose() *NetworkID

func (*NetworkIDInterval) Reserve

func (in *NetworkIDInterval) Reserve(id *NetworkID) []NetworkIDInterval

type NetworkList

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

NetworkList contains a list of Network

func (*NetworkList) DeepCopy

func (in *NetworkList) DeepCopy() *NetworkList

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

func (*NetworkList) DeepCopyInto

func (in *NetworkList) DeepCopyInto(out *NetworkList)

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

func (*NetworkList) DeepCopyObject

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

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

type NetworkSpec

type NetworkSpec struct {
	// ID is a unique network identifier.
	// For VXLAN it is a single 24 bit value. First 100 values are reserved.
	// For GENEVE it is a single 24 bit value. First 100 values are reserved.
	// For MLPS it is a set of 20 bit values. First 16 values are reserved.
	// Represented with number encoded to string.
	// +kubebuilder:validation:Optional
	ID *NetworkID `json:"id,omitempty"`
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Enum=VXLAN;GENEVE;MPLS
	Type NetworkType `json:"type,omitempty"`
	// Description contains a human readable description of network
	// +kubebuilder:validation:Optional
	Description string `json:"description,omitempty"`
}

NetworkSpec defines the desired state of Network

func (*NetworkSpec) DeepCopy

func (in *NetworkSpec) DeepCopy() *NetworkSpec

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

func (*NetworkSpec) DeepCopyInto

func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec)

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

type NetworkState

type NetworkState string
const (
	CFailedNetworkState     NetworkState = "Failed"
	CProcessingNetworkState NetworkState = "Processing"
	CFinishedNetworkState   NetworkState = "Finished"
)

type NetworkStatus

type NetworkStatus struct {
	// IPv4Ranges is a list of IPv4 ranges booked by child subnets
	IPv4Ranges []CIDR `json:"ipv4Ranges,omitempty"`
	// IPv6Ranges is a list of IPv6 ranges booked by child subnets
	IPv6Ranges []CIDR `json:"ipv6Ranges,omitempty"`
	// Reserved is a reserved network ID
	Reserved *NetworkID `json:"reserved,omitempty"`
	// IPv4Capacity is a total address capacity of all IPv4 CIDRs in Ranges
	IPv4Capacity resource.Quantity `json:"ipv4Capacity,omitempty"`
	// IPv6Capacity is a total address capacity of all IPv4 CIDRs in Ranges
	IPv6Capacity resource.Quantity `json:"ipv6Capacity,omitempty"`
	// State is a network creation request processing state
	State NetworkState `json:"state,omitempty"`
	// Message contains error details if the one has occurred
	Message string `json:"message,omitempty"`
}

NetworkStatus defines the observed state of Network

func (*NetworkStatus) DeepCopy

func (in *NetworkStatus) DeepCopy() *NetworkStatus

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

func (*NetworkStatus) DeepCopyInto

func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus)

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

type NetworkType

type NetworkType string

NetworkType is a type of network id is assigned to.

const (
	CGENEVENetworkType NetworkType = "GENEVE"
	CVXLANNetworkType  NetworkType = "VXLAN"
	CMPLSNetworkType   NetworkType = "MPLS"
)

type Region

type Region struct {
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=^[a-z0-9]([-./a-z0-9]*[a-z0-9])?$
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Name string `json:"name"`
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	AvailabilityZones []string `json:"availabilityZones"`
}

func (*Region) DeepCopy

func (in *Region) DeepCopy() *Region

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

func (*Region) DeepCopyInto

func (in *Region) DeepCopyInto(out *Region)

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

type ResourceReference

type ResourceReference struct {
	// APIVersion is resource's API group
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern=^[a-z0-9]([-./a-z0-9]*[a-z0-9])?$
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	APIVersion string `json:"apiVersion,omitempty"`
	// Kind is CRD Kind for lookup
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=^[A-Z]([-A-Za-z0-9]*[A-Za-z0-9])?$
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Kind string `json:"kind"`
	// Name is CRD Name for lookup
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	Name string `json:"name"`
}

ResourceReference allows to refer a resource of particular type at the same namespace

func (*ResourceReference) DeepCopy

func (in *ResourceReference) DeepCopy() *ResourceReference

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

func (*ResourceReference) DeepCopyInto

func (in *ResourceReference) DeepCopyInto(out *ResourceReference)

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

type StringSet

type StringSet map[string]struct{}

func (StringSet) DeepCopy

func (in StringSet) DeepCopy() StringSet

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

func (StringSet) DeepCopyInto

func (in StringSet) DeepCopyInto(out *StringSet)

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

func (StringSet) Put

func (s StringSet) Put(item string) error

type Subnet

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

	Spec   SubnetSpec   `json:"spec,omitempty"`
	Status SubnetStatus `json:"status,omitempty"`
}

Subnet is the Schema for the subnets API

func (*Subnet) CanRelease

func (in *Subnet) CanRelease(cidr *CIDR) bool

CanRelease checks whether it is possible to release CIDR into current vacant range

func (*Subnet) CanReserve

func (in *Subnet) CanReserve(cidr *CIDR) bool

CanReserve checks if it is possible to reserve CIDR

func (*Subnet) DeepCopy

func (in *Subnet) DeepCopy() *Subnet

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

func (*Subnet) DeepCopyInto

func (in *Subnet) DeepCopyInto(out *Subnet)

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

func (*Subnet) DeepCopyObject

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

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

func (*Subnet) FillStatusFromCidr

func (in *Subnet) FillStatusFromCidr(cidr *CIDR)

func (*Subnet) PopulateStatus

func (in *Subnet) PopulateStatus()

PopulateStatus fills status subresource with default values

func (*Subnet) ProposeForBits

func (in *Subnet) ProposeForBits(prefixBits byte) (*CIDR, error)

func (*Subnet) ProposeForCapacity

func (in *Subnet) ProposeForCapacity(capacity *resource.Quantity) (*CIDR, error)

func (*Subnet) Release

func (in *Subnet) Release(cidr *CIDR) error

Release puts CIDR to vacant range if there are no intersections and joins neighbour networks

func (*Subnet) Reserve

func (in *Subnet) Reserve(cidr *CIDR) error

Reserve books CIDR from the range of vacant CIDRs, if possible

func (*Subnet) SetupWebhookWithManager

func (in *Subnet) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Subnet) ValidateCreate

func (in *Subnet) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Subnet) ValidateDelete

func (in *Subnet) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Subnet) ValidateUpdate

func (in *Subnet) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type SubnetAddressType

type SubnetAddressType string

SubnetAddressType is a type (version) of IP protocol

type SubnetList

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

SubnetList contains a list of Subnet

func (*SubnetList) DeepCopy

func (in *SubnetList) DeepCopy() *SubnetList

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

func (*SubnetList) DeepCopyInto

func (in *SubnetList) DeepCopyInto(out *SubnetList)

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

func (*SubnetList) DeepCopyObject

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

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

type SubnetLocalityType

type SubnetLocalityType string

SubnetLocalityType is a type of subnet coverage

type SubnetSpec

type SubnetSpec struct {
	// CIDR represents the IP Address Range
	// +kubebuilder:validation:Optional
	CIDR *CIDR `json:"cidr,omitempty"`
	// PrefixBits is an amount of ones zero bits at the beginning of the netmask
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=128
	PrefixBits *byte `json:"prefixBits,omitempty"`
	// Capacity is a desired amount of addresses; will be ceiled to the closest power of 2.
	// +kubebuilder:validation:Optional
	Capacity *resource.Quantity `json:"capacity,omitempty"`
	// ParentSubnetName contains a reference (name) to the parent subent
	// +kubebuilder:validation:Optional
	ParentSubnet v1.LocalObjectReference `json:"parentSubnet,omitempty"`
	// NetworkName contains a reference (name) to the network
	// +kubebuilder:validation:Required
	Network v1.LocalObjectReference `json:"network"`
	// Regions represents the network service location
	// +kubebuilder:validation:Optional
	Regions []Region `json:"regions,omitempty"`
	// Consumer refers to resource Subnet has been booked for
	// +kubebuilder:validation:Optional
	Consumer *ResourceReference `json:"consumer,omitempty"`
}

SubnetSpec defines the desired state of Subnet

func (*SubnetSpec) DeepCopy

func (in *SubnetSpec) DeepCopy() *SubnetSpec

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

func (*SubnetSpec) DeepCopyInto

func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec)

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

type SubnetState

type SubnetState string

SubnetState is a processing state of subnet resource

type SubnetStatus

type SubnetStatus struct {
	// Type represents whether CIDR is an IPv4 or IPv6
	Type SubnetAddressType `json:"type,omitempty"`
	// Locality represents subnet regional coverated
	Locality SubnetLocalityType `json:"locality,omitempty"`
	// PrefixBits is an amount of ones zero bits at the beginning of the netmask
	PrefixBits byte `json:"prefixBits,omitempty"`
	// Capacity shows total capacity of CIDR
	Capacity resource.Quantity `json:"capacity,omitempty"`
	// CapacityLeft shows remaining capacity (excluding capacity of child subnets)
	CapacityLeft resource.Quantity `json:"capacityLeft,omitempty"`
	// Reserved is a CIDR that was reserved
	Reserved *CIDR `json:"reserved,omitempty"`
	// Vacant shows CIDR ranges available for booking
	Vacant []CIDR `json:"vacant,omitempty"`
	// State represents the cunnet processing state
	State SubnetState `json:"state,omitempty"`
	// Message contains an error string for the failed State
	Message string `json:"message,omitempty"`
}

SubnetStatus defines the observed state of Subnet

func (*SubnetStatus) DeepCopy

func (in *SubnetStatus) DeepCopy() *SubnetStatus

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

func (*SubnetStatus) DeepCopyInto

func (in *SubnetStatus) DeepCopyInto(out *SubnetStatus)

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