v1alpha1

package
v0.0.4-0...-a9777c3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the ipam v1alpha1 API group +kubebuilder:object:generate=true +groupName=ipam.resource.nephio.org

Index

Constants

View Source
const (
	OriginSystem       = "system"
	SubnetPrefix       = "subnet"
	SubnetFirstAddress = "first"
	SubnetLastAddress  = "last"
)
View Source
const IPClaimPlural = "ipclaims"
View Source
const (
	NetworkInstancePrefixAggregate = "aggregate"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "ipam.resource.nephio.org", Version: "v1alpha1"}

	// 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 (
	IPClaimKind             = reflect.TypeOf(IPClaim{}).Name()
	IPClaimGroupKind        = schema.GroupKind{Group: GroupVersion.Group, Kind: IPClaimKind}.String()
	IPClaimKindAPIVersion   = IPClaimKind + "." + GroupVersion.String()
	IPClaimGroupVersionKind = GroupVersion.WithKind(IPClaimKind)
	IPClaimKindGVKString    = meta.GVKToString(schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: GroupVersion.Version,
		Kind:    IPClaimKind,
	})
)
View Source
var (
	IPPrefixKind             = reflect.TypeOf(IPPrefix{}).Name()
	IPPrefixGroupKind        = schema.GroupKind{Group: GroupVersion.Group, Kind: IPPrefixKind}.String()
	IPPrefixKindAPIVersion   = IPPrefixKind + "." + GroupVersion.String()
	IPPrefixGroupVersionKind = GroupVersion.WithKind(IPPrefixKind)
	IPPrefixKindGVKString    = meta.GVKToString(schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: GroupVersion.Version,
		Kind:    IPPrefixKind,
	})
)
View Source
var (
	NetworkInstanceKind             = reflect.TypeOf(NetworkInstance{}).Name()
	NetworkInstancegroupKind        = schema.GroupKind{Group: GroupVersion.Group, Kind: NetworkInstanceKind}.String()
	NetworkInstanceAPIVersion       = NetworkInstanceKind + "." + GroupVersion.String()
	NetworkInstanceGroupVersionKind = GroupVersion.WithKind(NetworkInstanceKind)
	NetworkInstanceKindGVKString    = meta.GVKToString(schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: GroupVersion.Version,
		Kind:    NetworkInstanceKind,
	})
)

Functions

func GetNameFromPrefix

func GetNameFromPrefix(prefix, name, suffix string) string

Types

type AddressClaimCOntext

type AddressClaimCOntext struct {
	AddressClaimName         string
	AddressSelectorLabels    map[string]string
	AddressUserDefinedLabels map[string]string
}

func (*AddressClaimCOntext) DeepCopy

func (in *AddressClaimCOntext) DeepCopy() *AddressClaimCOntext

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

func (*AddressClaimCOntext) DeepCopyInto

func (in *AddressClaimCOntext) DeepCopyInto(out *AddressClaimCOntext)

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

type IPClaim

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

	Spec   IPClaimSpec   `json:"spec,omitempty" yaml:"spec,omitempty"`
	Status IPClaimStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="SYNC",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +kubebuilder:printcolumn:name="STATUS",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +kubebuilder:printcolumn:name="NETWORK-INSTANCE",type="string",JSONPath=".spec.networkInstance.name" +kubebuilder:printcolumn:name="KIND",type="string",JSONPath=".spec.kind" +kubebuilder:printcolumn:name="AF",type="string",JSONPath=".spec.addressFamily" +kubebuilder:printcolumn:name="PREFIXLENGTH",type="string",JSONPath=".spec.prefixLength" +kubebuilder:printcolumn:name="PREFIX-REQ",type="string",JSONPath=".spec.prefix" +kubebuilder:printcolumn:name="PREFIX-ALLOC",type="string",JSONPath=".status.prefix" +kubebuilder:printcolumn:name="GATEWAY",type="string",JSONPath=".status.gateway" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:resource:categories={nephio,resource} IPClaim is the Schema for the ipclaim API

func BuildIPClaim

func BuildIPClaim(meta metav1.ObjectMeta, spec IPClaimSpec, status IPClaimStatus) *IPClaim

BuildIPClaim returns an IP Claim from a client Object a crName and an IPClaim Spec/Status

func (*IPClaim) AddOwnerLabelsToCR

func (r *IPClaim) AddOwnerLabelsToCR()

AddOwnerLabelsToCR returns a VLANClaim by augmenting the owner GVK/NSN in the user defined labels

func (*IPClaim) DeepCopy

func (in *IPClaim) DeepCopy() *IPClaim

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

func (*IPClaim) DeepCopyInto

func (in *IPClaim) DeepCopyInto(out *IPClaim)

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

func (*IPClaim) DeepCopyObject

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

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

func (*IPClaim) GetCacheID

func (r *IPClaim) GetCacheID() corev1.ObjectReference

GetCacheID return the cache id validating the namespace

func (*IPClaim) GetCondition

GetCondition returns the condition based on the condition kind

func (*IPClaim) GetDummyLabelsFromPrefix

func (r *IPClaim) GetDummyLabelsFromPrefix(pi iputil.Prefix) map[string]string

GetDummyLabelsFromPrefix returns a map with the labels from the spec augmented with the prefixkind and the subnet from the prefixInfo

func (*IPClaim) GetFullLabels

func (r *IPClaim) GetFullLabels() map[string]string

GetFullLabels returns a map with a copy of the user defined labels and the selector labels

func (*IPClaim) GetGatewayLabelSelector

func (r *IPClaim) GetGatewayLabelSelector(subnetString string) (labels.Selector, error)

GetGatewayLabelSelector returns a label selector to select the gateway of the claim in the backend

func (*IPClaim) GetGenericNamespacedName

func (r *IPClaim) GetGenericNamespacedName() string

GetGenericNamespacedName return a namespace and name as string, compliant to the k8s api naming convention

func (IPClaim) GetGroupVersionResource

func (IPClaim) GetGroupVersionResource() schema.GroupVersionResource

func (*IPClaim) GetLabelSelector

func (r *IPClaim) GetLabelSelector() (labels.Selector, error)

GetLabelSelector returns a labels selector based on the label selector

func (*IPClaim) GetObjectMeta

func (r *IPClaim) GetObjectMeta() *metav1.ObjectMeta

GetObjectMeta implements resource.Object

func (*IPClaim) GetOwnerSelector

func (r *IPClaim) GetOwnerSelector() (labels.Selector, error)

GetOwnerSelector returns a label selector to select the owner of the claim in the backend

func (*IPClaim) GetPrefixLengthFromClaim

func (r *IPClaim) GetPrefixLengthFromClaim(route table.Route) uint8

GetPrefixLengthFromClaim returns the prefixlength, bu validating the prefixlength in the spec. if undefined a /32 or .128 is returned based on the prefix in the route

func (*IPClaim) GetPrefixLengthFromRoute

func (r *IPClaim) GetPrefixLengthFromRoute(route table.Route) iputil.PrefixLength

GetPrefixLengthFromRoute returns the prefixlength of the ip claim if defined in the spec otherwise the route prefix is returned

func (*IPClaim) GetSelectorLabels

func (r *IPClaim) GetSelectorLabels() map[string]string

GetSelectorLabels returns a map with a copy of the selector labels

func (*IPClaim) GetUserDefinedLabels

func (r *IPClaim) GetUserDefinedLabels() map[string]string

GetUserDefinedLabels returns a map with a copy of the user defined labels

func (*IPClaim) IsCreatePrefixAllcationValid

func (r *IPClaim) IsCreatePrefixAllcationValid() (bool, error)

IsCreatePrefixAllcationValid validates the IP Claim and returns an error when the validation fails When CreatePrefix is set and Prefix is set, the prefix cannot be an address prefix When CreatePrefix is set and Prefix is not set, the prefixlength must be defined When CreatePrefix is not set and Prefix is set, the prefix must be an address - static address claim When CreatePrefix is not set and Prefix is not set, this is a dynamic address claim

func (IPClaim) IsStorageVersion

func (IPClaim) IsStorageVersion() bool

IsStorageVersion returns true -- v1alpha1.Config is used as the internal version. IsStorageVersion implements resource.Object.

func (IPClaim) NamespaceScoped

func (IPClaim) NamespaceScoped() bool

NamespaceScoped returns true to indicate Fortune is a namespaced resource. NamespaceScoped implements resource.Object.

func (IPClaim) New

func (IPClaim) New() runtime.Object

New implements resource.Object

func (IPClaim) NewList

func (IPClaim) NewList() runtime.Object

NewList implements resource.Object

func (*IPClaim) ObjectKinds

func (t *IPClaim) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error)

func (*IPClaim) SetConditions

func (r *IPClaim) SetConditions(c ...resourcev1alpha1.Condition)

SetConditions sets the conditions on the resource. it allows for 0, 1 or more conditions to be set at once

type IPClaimList

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

IPClaimList contains a list of IPClaims

func (*IPClaimList) DeepCopy

func (in *IPClaimList) DeepCopy() *IPClaimList

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

func (*IPClaimList) DeepCopyInto

func (in *IPClaimList) DeepCopyInto(out *IPClaimList)

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

func (*IPClaimList) DeepCopyObject

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

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

func (*IPClaimList) GetListMeta

func (r *IPClaimList) GetListMeta() *metav1.ListMeta

GetListMeta returns the ListMeta

type IPClaimSpec

type IPClaimSpec struct {
	// Kind defines the kind of prefix for the IP Claim
	// - network kind is used for physical, virtual nics on a device
	// - loopback kind is used for loopback interfaces
	// - pool kind is used for pools for dhcp/radius/bng/upf/etc
	// - aggregate kind is used for claiming an aggregate prefix
	// +kubebuilder:validation:Enum=`network`;`loopback`;`pool`;`aggregate`
	// +kubebuilder:default=network
	Kind PrefixKind `json:"kind" yaml:"kind"`
	// NetworkInstance defines the networkInstance context for the IP claim
	// Name and optionally Namespace is used here
	NetworkInstance corev1.ObjectReference `json:"networkInstance" yaml:"networkInstance"`
	// AddressFamily defines the address family for the IP claim
	// +kubebuilder:validation:Enum=`ipv4`;`ipv6`
	// +kubebuilder:validation:Optional
	AddressFamily *iputil.AddressFamily `json:"addressFamily,omitempty" yaml:"addressFamily,omitempty"`
	// Prefix defines the prefix for the IP claim
	// Used for specific prefix claim or used as a hint for a dynamic prefix claim in case of restart
	// +kubebuilder:validation:Pattern=`(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))|((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))`
	// +kubebuilder:validation:Optional
	Prefix *string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
	// PrefixLength defines the prefix length for the IP Claim
	// If not present we use assume /32 for ipv4 and /128 for ipv6
	// +kubebuilder:validation:Optional
	PrefixLength *uint8 `json:"prefixLength,omitempty" yaml:"prefixLength,omitempty"`
	// Index defines the index of the IP Claim, used to get a deterministic IP from a prefix
	// If not present we claim a random prefix from a prefix
	// +kubebuilder:validation:Optional
	Index *uint32 `json:"index,omitempty" yaml:"index,omitempty"`
	// CreatePrefix defines if this prefix must be created. Only used for non address prefixes
	// e.g. non /32 ipv4 and non /128 ipv6 prefixes
	// +kubebuilder:validation:Optional
	CreatePrefix *bool `json:"createPrefix,omitempty" yaml:"createPrefix,omitempty"`
	// ClaimLabels define the user defined labels and selector labels used
	// in resource claim
	resourcev1alpha1.ClaimLabels `json:",inline" yaml:",inline"`
}

IPClaimSpec defines the desired state of IPClaim

func (*IPClaimSpec) DeepCopy

func (in *IPClaimSpec) DeepCopy() *IPClaimSpec

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

func (*IPClaimSpec) DeepCopyInto

func (in *IPClaimSpec) DeepCopyInto(out *IPClaimSpec)

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

type IPClaimStatus

type IPClaimStatus struct {
	// ConditionedStatus provides the status of the IP claim using conditions
	// 2 conditions are used:
	// - a condition for the reconcilation status
	// - a condition for the ready status
	// if both are true the other attributes in the status are meaningful
	resourcev1alpha1.ConditionedStatus `json:",inline" yaml:",inline"`
	// Prefix defines the prefix, claimed through the IPAM backend
	// +kubebuilder:validation:Optional
	Prefix *string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
	// Gateway defines the gateway IP for the claimed prefix
	// Gateway is only relevant for prefix kind = network
	// +kubebuilder:validation:Optional
	Gateway *string `json:"gateway,omitempty" yaml:"gateway,omitempty"`
	// ExpiryTime defines when the claim expires
	// +kubebuilder:validation:Optional
	ExpiryTime *string `json:"expiryTime,omitempty" yaml:"expiryTime,omitempty"`
}

IPClaimStatus defines the observed state of IPClaim

func (*IPClaimStatus) DeepCopy

func (in *IPClaimStatus) DeepCopy() *IPClaimStatus

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

func (*IPClaimStatus) DeepCopyInto

func (in *IPClaimStatus) DeepCopyInto(out *IPClaimStatus)

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

type IPPrefix

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

	Spec   IPPrefixSpec   `json:"spec,omitempty" yaml:"spec,omitempty"`
	Status IPPrefixStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

IPPrefix is the Schema for the ipprefixes API

func BuildIPPrefix

func BuildIPPrefix(meta metav1.ObjectMeta, spec IPPrefixSpec, status IPPrefixStatus) *IPPrefix

BuildIPPrefix returns an IP Prefix from a client Object a crName and an IpPrefix Spec/Status

func (*IPPrefix) DeepCopy

func (in *IPPrefix) DeepCopy() *IPPrefix

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

func (*IPPrefix) DeepCopyInto

func (in *IPPrefix) DeepCopyInto(out *IPPrefix)

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

func (*IPPrefix) DeepCopyObject

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

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

func (*IPPrefix) GetCacheID

func (r *IPPrefix) GetCacheID() corev1.ObjectReference

GetCacheID return the cache id validating the namespace

func (*IPPrefix) GetCondition

GetCondition returns the condition based on the condition kind

func (*IPPrefix) GetGenericNamespacedName

func (r *IPPrefix) GetGenericNamespacedName() string

GetGenericNamespacedName return a namespace and name as string, compliant to the k8s api naming convention

func (*IPPrefix) GetUserDefinedLabels

func (r *IPPrefix) GetUserDefinedLabels() map[string]string

GetUserDefinedLabels returns the user defined labels in the spec

func (*IPPrefix) SetConditions

func (r *IPPrefix) SetConditions(c ...resourcev1alpha1.Condition)

SetConditions sets the conditions on the resource. it allows for 0, 1 or more conditions to be set at once

type IPPrefixList

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

IPPrefixList contains a list of IPPrefix

func (*IPPrefixList) DeepCopy

func (in *IPPrefixList) DeepCopy() *IPPrefixList

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

func (*IPPrefixList) DeepCopyInto

func (in *IPPrefixList) DeepCopyInto(out *IPPrefixList)

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

func (*IPPrefixList) DeepCopyObject

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

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

type IPPrefixSpec

type IPPrefixSpec struct {
	// Kind defines the kind of prefix for the IP Claim
	// - network kind is used for physical, virtual nics on a device
	// - loopback kind is used for loopback interfaces
	// - pool kind is used for pools for dhcp/radius/bng/upf/etc
	// - aggregate kind is used for claiming an aggregate prefix
	// +kubebuilder:validation:Enum=`network`;`loopback`;`pool`;`aggregate`
	// +kubebuilder:default=network
	Kind PrefixKind `json:"kind" yaml:"kind"`
	// NetworkInstance defines the networkInstance context for the IP prefix
	// Name and optionally Namespace is used here
	NetworkInstance corev1.ObjectReference `json:"networkInstance" yaml:"networkInstance"`
	// Prefix defines the ip cidr in prefix or address notation.
	// +kubebuilder:validation:Pattern=`(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))|((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))`
	Prefix string `json:"prefix" yaml:"prefix"`
	// UserDefinedLabels define metadata to the resource.
	// defined in the spec to distingiush metadata labels from user defined labels
	resourcev1alpha1.UserDefinedLabels `json:",inline" yaml:",inline"`
}

IPPrefixSpec defines the desired state of IPPrefix

func (*IPPrefixSpec) DeepCopy

func (in *IPPrefixSpec) DeepCopy() *IPPrefixSpec

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

func (*IPPrefixSpec) DeepCopyInto

func (in *IPPrefixSpec) DeepCopyInto(out *IPPrefixSpec)

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

type IPPrefixStatus

type IPPrefixStatus struct {
	// ConditionedStatus provides the status of the IPPrefix claim using conditions
	// 2 conditions are used:
	// - a condition for the reconcilation status
	// - a condition for the ready status
	// if both are true the other attributes in the status are meaningful
	resourcev1alpha1.ConditionedStatus `json:",inline" yaml:",inline"`
	// Prefix defines the prefix, claimed through the IPAM backend
	// +kubebuilder:validation:Optional
	Prefix *string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
}

IPPrefixStatus defines the observed state of IPPrefix

func (*IPPrefixStatus) DeepCopy

func (in *IPPrefixStatus) DeepCopy() *IPPrefixStatus

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

func (*IPPrefixStatus) DeepCopyInto

func (in *IPPrefixStatus) DeepCopyInto(out *IPPrefixStatus)

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

type Labels

type Labels map[string]string

func (Labels) DeepCopy

func (in Labels) DeepCopy() Labels

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

func (Labels) DeepCopyInto

func (in Labels) DeepCopyInto(out *Labels)

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

func (Labels) GetPurposeLabels

func (r Labels) GetPurposeLabels(purpose string) map[string]string

type NetworkInstance

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

	Spec   NetworkInstanceSpec   `json:"spec,omitempty" yaml:"spec,omitempty"`
	Status NetworkInstanceStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="SYNC",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +kubebuilder:printcolumn:name="STATUS",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +kubebuilder:printcolumn:name="NETWORK-INSTANCE",type="string",JSONPath=".metadata.name" +kubebuilder:printcolumn:name="PREFIX0",type="string",JSONPath=".spec.prefixes[0].prefix" +kubebuilder:printcolumn:name="PREFIX1",type="string",JSONPath=".spec.prefixes[1].prefix" +kubebuilder:printcolumn:name="PREFIX2",type="string",JSONPath=".spec.prefixes[2].prefix" +kubebuilder:printcolumn:name="PREFIX3",type="string",JSONPath=".spec.prefixes[3].prefix" +kubebuilder:printcolumn:name="PREFIX4",type="string",JSONPath=".spec.prefixes[4].prefix" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:resource:categories={nephio,resource} NetworkInstance is the Schema for the networkinstances API

func BuildNetworkInstance

func BuildNetworkInstance(meta metav1.ObjectMeta, spec NetworkInstanceSpec, status NetworkInstanceStatus) *NetworkInstance

BuildNetworkInstance returns a networkInstance based on meta, spec and statis

func (*NetworkInstance) DeepCopy

func (in *NetworkInstance) DeepCopy() *NetworkInstance

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

func (*NetworkInstance) DeepCopyInto

func (in *NetworkInstance) DeepCopyInto(out *NetworkInstance)

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

func (*NetworkInstance) DeepCopyObject

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

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

func (*NetworkInstance) GetCacheID

func (r *NetworkInstance) GetCacheID() corev1.ObjectReference

GetCacheID returns a CacheID as an objectReference

func (*NetworkInstance) GetCondition

GetCondition returns the condition based on the condition kind

func (*NetworkInstance) GetGenericNamespacedName

func (r *NetworkInstance) GetGenericNamespacedName() string

GetGenericNamespacedName return a namespace and name as string, compliant to the k8s api naming convention

func (*NetworkInstance) GetNameFromNetworkInstancePrefix

func (r *NetworkInstance) GetNameFromNetworkInstancePrefix(prefix string) string

GetNameFromNetworkInstancePrefix return a network instance prefix name It provides a unique name by concatenating the networkinstance name with a predefined name (aggregate) and a prefix, compliant to the naming convention of k8s

func (*NetworkInstance) GetNamespacedName

func (r *NetworkInstance) GetNamespacedName() types.NamespacedName

GetNamespacedName returns the namespace and name

func (*NetworkInstance) SetConditions

func (r *NetworkInstance) SetConditions(c ...resourcev1alpha1.Condition)

SetConditions sets the conditions on the resource. it allows for 0, 1 or more conditions to be set at once

type NetworkInstanceList

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

NetworkInstanceList contains a list of NetworkInstance

func (*NetworkInstanceList) DeepCopy

func (in *NetworkInstanceList) DeepCopy() *NetworkInstanceList

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

func (*NetworkInstanceList) DeepCopyInto

func (in *NetworkInstanceList) DeepCopyInto(out *NetworkInstanceList)

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

func (*NetworkInstanceList) DeepCopyObject

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

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

type NetworkInstanceSpec

type NetworkInstanceSpec struct {
	// Prefixes define the aggregate prefixes for the network instance
	// A Network instance needs at least 1 prefix to be defined to become operational
	Prefixes []Prefix `json:"prefixes" yaml:"prefixes"`
}

NetworkInstanceSpec defines the desired state of NetworkInstance

func (*NetworkInstanceSpec) DeepCopy

func (in *NetworkInstanceSpec) DeepCopy() *NetworkInstanceSpec

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

func (*NetworkInstanceSpec) DeepCopyInto

func (in *NetworkInstanceSpec) DeepCopyInto(out *NetworkInstanceSpec)

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

type NetworkInstanceStatus

type NetworkInstanceStatus struct {
	// ConditionedStatus provides the status of the NI using conditions
	// 2 conditions are used:
	// - a condition for the reconcilation status
	// - a condition for the ready status
	// if both are true the other attributes in the status are meaningful
	resourcev1alpha1.ConditionedStatus `json:",inline" yaml:",inline"`
	// Prefixes defines the prefixes, claimed through the IPAM backend
	Prefixes []Prefix `json:"prefixes,omitempty" yaml:"prefixes,omitempty"`
}

NetworkInstanceStatus defines the observed state of NetworkInstance

func (*NetworkInstanceStatus) DeepCopy

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

func (*NetworkInstanceStatus) DeepCopyInto

func (in *NetworkInstanceStatus) DeepCopyInto(out *NetworkInstanceStatus)

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

type Prefix

type Prefix struct {
	// Prefix defines the ip cidr in prefix notation.
	// +kubebuilder:validation:Pattern=`(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))|((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))`
	Prefix string `json:"prefix" yaml:"prefix"`
	// UserDefinedLabels define metadata to the resource.
	// defined in the spec to distingiush metadata labels from user defined labels
	resourcev1alpha1.UserDefinedLabels `json:",inline" yaml:",inline"`
}

func (*Prefix) DeepCopy

func (in *Prefix) DeepCopy() *Prefix

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

func (*Prefix) DeepCopyInto

func (in *Prefix) DeepCopyInto(out *Prefix)

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

func (*Prefix) GetAddressClaimContext

func (r *Prefix) GetAddressClaimContext(rtName, nodeName, namespace string, labels Labels) *AddressClaimCOntext

func (*Prefix) GetAddressSelectorLabels

func (r *Prefix) GetAddressSelectorLabels(name, namespace string) map[string]string

func (*Prefix) GetPrefixClaimContext

func (r *Prefix) GetPrefixClaimContext(rtName, bdName, linkName, nodeName, namespace string, labels Labels) *PrefixClaimContext

GetPrefixClaimContext return selectors and user defined labels the claim is based on prefix namings used internally and is hierarchical for irb there is a special case since the top prefix is claimed in the routing context the 2nd prefix get a name of the bridge context. As such we have rtNmame and bdName

func (*Prefix) GetPrefixKind

func (r *Prefix) GetPrefixKind() PrefixKind

func (*Prefix) GetPrefixSelectorLabels

func (r *Prefix) GetPrefixSelectorLabels(name, namespace string) map[string]string

func (*Prefix) GetPrefixUserDefinedLabels

func (r *Prefix) GetPrefixUserDefinedLabels(labels map[string]string, value string) map[string]string

type PrefixClaimContext

type PrefixClaimContext struct {
	PrefixClaimName         string
	PrefixSelectorLabels    map[string]string
	PrefixUserDefinedLabels map[string]string

	AddressClaimCOntext
}

func (*PrefixClaimContext) DeepCopy

func (in *PrefixClaimContext) DeepCopy() *PrefixClaimContext

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

func (*PrefixClaimContext) DeepCopyInto

func (in *PrefixClaimContext) DeepCopyInto(out *PrefixClaimContext)

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

type PrefixKind

type PrefixKind string
const (
	PrefixKindUnknown   PrefixKind = "unknown"
	PrefixKindNetwork   PrefixKind = "network"
	PrefixKindLoopback  PrefixKind = "loopback"
	PrefixKindPool      PrefixKind = "pool"
	PrefixKindAggregate PrefixKind = "aggregate"
)

func GetPrefixKindFromString

func GetPrefixKindFromString(s string) PrefixKind

Jump to

Keyboard shortcuts

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