Documentation
¶
Index ¶
- Variables
- func GetGatewayForSubnet(subnet *net.IPNet, index int32) string
- func GetPossibleIPCount(subnet *net.IPNet) *big.Int
- type Allocation
- type CIDRPool
- func (in *CIDRPool) DeepCopy() *CIDRPool
- func (in *CIDRPool) DeepCopyInto(out *CIDRPool)
- func (in *CIDRPool) DeepCopyObject() runtime.Object
- func (r *CIDRPool) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (r *CIDRPool) Validate() field.ErrorList
- func (r *CIDRPool) ValidateCreate() (admission.Warnings, error)
- func (r *CIDRPool) ValidateDelete() (admission.Warnings, error)
- func (r *CIDRPool) ValidateUpdate(_ runtime.Object) (admission.Warnings, error)
- type CIDRPoolAllocation
- type CIDRPoolList
- type CIDRPoolSpec
- type CIDRPoolStaticAllocation
- type CIDRPoolStatus
- type ExcludeRange
- type IPPool
- func (in *IPPool) DeepCopy() *IPPool
- func (in *IPPool) DeepCopyInto(out *IPPool)
- func (in *IPPool) DeepCopyObject() runtime.Object
- func (r *IPPool) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (r *IPPool) Validate() field.ErrorList
- func (r *IPPool) ValidateCreate() (admission.Warnings, error)
- func (r *IPPool) ValidateDelete() (admission.Warnings, error)
- func (r *IPPool) ValidateUpdate(_ runtime.Object) (admission.Warnings, error)
- type IPPoolList
- type IPPoolSpec
- type IPPoolStatus
- type Route
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "nv-ipam.nvidia.com", 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 )
Functions ¶
func GetGatewayForSubnet ¶ added in v0.2.0
GetGatewayForSubnet returns computed gateway for subnet as string, index 0 means no gw Examples: - subnet 192.168.0.0/24, index = 0, gateway = "" (invalid config, can't use network address as gateway ) - subnet 192.168.0.0/24, index 1, gateway = 192.168.1.1 - subnet 192.168.0.0/24, index 10, gateway = 102.168.1.10 - subnet 192.168.1.2/31, index 0, gateway = 192.168.1.2 (point to point network can use network IP as a gateway) - subnet 192.168.33.0/24, index 900, gateway = "" (invalid config, index too large)
func GetPossibleIPCount ¶ added in v0.2.0
GetPossibleIPCount returns count of IP addresses for hosts in the provided subnet. for IPv4: returns amount of IPs - 2 (subnet address and broadcast address) for IPv6: returns amount of IPs - 1 (subnet address) for point to point subnets(/31 and /127) returns 2
Types ¶
type Allocation ¶
type Allocation struct { NodeName string `json:"nodeName"` StartIP string `json:"startIP"` EndIP string `json:"endIP"` }
Allocation contains IP Allocation for a specific Node
func (*Allocation) DeepCopy ¶
func (in *Allocation) DeepCopy() *Allocation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Allocation.
func (*Allocation) DeepCopyInto ¶
func (in *Allocation) DeepCopyInto(out *Allocation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CIDRPool ¶ added in v0.2.0
type CIDRPool struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec CIDRPoolSpec `json:"spec"` Status CIDRPoolStatus `json:"status,omitempty"` }
CIDRPool contains configuration for CIDR pool
func (*CIDRPool) DeepCopy ¶ added in v0.2.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CIDRPool.
func (*CIDRPool) DeepCopyInto ¶ added in v0.2.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CIDRPool) DeepCopyObject ¶ added in v0.2.0
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*CIDRPool) SetupWebhookWithManager ¶ added in v0.2.0
SetupWebhookWithManager registers webhook handler in the manager
func (*CIDRPool) ValidateCreate ¶ added in v0.2.0
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*CIDRPool) ValidateDelete ¶ added in v0.2.0
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
type CIDRPoolAllocation ¶ added in v0.2.0
type CIDRPoolAllocation struct { // name of the node which owns this allocation NodeName string `json:"nodeName"` // gateway for the node Gateway string `json:"gateway,omitempty"` // allocated prefix Prefix string `json:"prefix"` }
CIDRPoolAllocation contains prefix allocated for a specific Node
func (*CIDRPoolAllocation) DeepCopy ¶ added in v0.2.0
func (in *CIDRPoolAllocation) DeepCopy() *CIDRPoolAllocation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CIDRPoolAllocation.
func (*CIDRPoolAllocation) DeepCopyInto ¶ added in v0.2.0
func (in *CIDRPoolAllocation) DeepCopyInto(out *CIDRPoolAllocation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CIDRPoolList ¶ added in v0.2.0
type CIDRPoolList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []CIDRPool `json:"items"` }
CIDRPoolList contains a list of CIDRPool
func (*CIDRPoolList) DeepCopy ¶ added in v0.2.0
func (in *CIDRPoolList) DeepCopy() *CIDRPoolList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CIDRPoolList.
func (*CIDRPoolList) DeepCopyInto ¶ added in v0.2.0
func (in *CIDRPoolList) DeepCopyInto(out *CIDRPoolList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CIDRPoolList) DeepCopyObject ¶ added in v0.2.0
func (in *CIDRPoolList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CIDRPoolSpec ¶ added in v0.2.0
type CIDRPoolSpec struct { // pool CIDR block which will be split to smaller prefixes(size is define in perNodeNetworkPrefix) // and distributed between matching nodes CIDR string `json:"cidr"` // use IP with this index from the host prefix as a gateway, skip gateway configuration if the value not set GatewayIndex *int32 `json:"gatewayIndex,omitempty"` // size of the network prefix for each host, the network defined in "cidr" field will be split to multiple networks // with this size. PerNodeNetworkPrefix int32 `json:"perNodeNetworkPrefix"` // contains reserved IP addresses that should not be allocated by nv-ipam Exclusions []ExcludeRange `json:"exclusions,omitempty"` // static allocations for the pool StaticAllocations []CIDRPoolStaticAllocation `json:"staticAllocations,omitempty"` // selector for nodes, if empty match all nodes NodeSelector *corev1.NodeSelector `json:"nodeSelector,omitempty"` // if true, add gateway as default gateway in the routes list DefaultGateway bool `json:"defaultGateway,omitempty"` // static routes list. The gateway used will according to the node allocation. Routes []Route `json:"routes,omitempty"` }
CIDRPoolSpec contains configuration for CIDR pool
func (*CIDRPoolSpec) DeepCopy ¶ added in v0.2.0
func (in *CIDRPoolSpec) DeepCopy() *CIDRPoolSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CIDRPoolSpec.
func (*CIDRPoolSpec) DeepCopyInto ¶ added in v0.2.0
func (in *CIDRPoolSpec) DeepCopyInto(out *CIDRPoolSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CIDRPoolStaticAllocation ¶ added in v0.2.0
type CIDRPoolStaticAllocation struct { // name of the node for static allocation, can be empty in case if the prefix // should be preallocated without assigning it for a specific node NodeName string `json:"nodeName,omitempty"` // gateway for the node Gateway string `json:"gateway,omitempty"` // statically allocated prefix Prefix string `json:"prefix"` }
CIDRPoolStaticAllocation contains static allocation for a CIDR pool
func (*CIDRPoolStaticAllocation) DeepCopy ¶ added in v0.2.0
func (in *CIDRPoolStaticAllocation) DeepCopy() *CIDRPoolStaticAllocation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CIDRPoolStaticAllocation.
func (*CIDRPoolStaticAllocation) DeepCopyInto ¶ added in v0.2.0
func (in *CIDRPoolStaticAllocation) DeepCopyInto(out *CIDRPoolStaticAllocation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CIDRPoolStatus ¶ added in v0.2.0
type CIDRPoolStatus struct { // prefixes allocations for Nodes Allocations []CIDRPoolAllocation `json:"allocations"` }
CIDRPoolStatus contains the IP prefixes allocated to nodes
func (*CIDRPoolStatus) DeepCopy ¶ added in v0.2.0
func (in *CIDRPoolStatus) DeepCopy() *CIDRPoolStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CIDRPoolStatus.
func (*CIDRPoolStatus) DeepCopyInto ¶ added in v0.2.0
func (in *CIDRPoolStatus) DeepCopyInto(out *CIDRPoolStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ExcludeRange ¶ added in v0.2.0
ExcludeRange contains range of IP addresses to exclude from allocation startIP and endIP are part of the ExcludeRange
func (*ExcludeRange) DeepCopy ¶ added in v0.2.0
func (in *ExcludeRange) DeepCopy() *ExcludeRange
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExcludeRange.
func (*ExcludeRange) DeepCopyInto ¶ added in v0.2.0
func (in *ExcludeRange) DeepCopyInto(out *ExcludeRange)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IPPool ¶
type IPPool struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec IPPoolSpec `json:"spec"` Status IPPoolStatus `json:"status,omitempty"` }
IPPool contains configuration for IPAM controller
func (*IPPool) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPool.
func (*IPPool) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*IPPool) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*IPPool) SetupWebhookWithManager ¶ added in v0.1.1
SetupWebhookWithManager registers webhook handler in the manager
func (*IPPool) ValidateCreate ¶ added in v0.1.1
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*IPPool) ValidateDelete ¶ added in v0.1.1
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
type IPPoolList ¶
type IPPoolList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []IPPool `json:"items"` }
IPPoolList contains a list of IPPool
func (*IPPoolList) DeepCopy ¶
func (in *IPPoolList) DeepCopy() *IPPoolList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPoolList.
func (*IPPoolList) DeepCopyInto ¶
func (in *IPPoolList) DeepCopyInto(out *IPPoolList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*IPPoolList) DeepCopyObject ¶
func (in *IPPoolList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type IPPoolSpec ¶
type IPPoolSpec struct { // subnet of the pool Subnet string `json:"subnet"` // amount of IPs to allocate for each node, // must be less than amount of available IPs in the subnet PerNodeBlockSize int `json:"perNodeBlockSize"` // contains reserved IP addresses that should not be allocated by nv-ipam Exclusions []ExcludeRange `json:"exclusions,omitempty"` // gateway for the pool Gateway string `json:"gateway,omitempty"` // selector for nodes, if empty match all nodes NodeSelector *corev1.NodeSelector `json:"nodeSelector,omitempty"` // if true, add gateway as default gateway in the routes list DefaultGateway bool `json:"defaultGateway,omitempty"` // static routes list using the gateway specified in the spec. Routes []Route `json:"routes,omitempty"` }
IPPoolSpec contains configuration for IP pool
func (*IPPoolSpec) DeepCopy ¶
func (in *IPPoolSpec) DeepCopy() *IPPoolSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPoolSpec.
func (*IPPoolSpec) DeepCopyInto ¶
func (in *IPPoolSpec) DeepCopyInto(out *IPPoolSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IPPoolStatus ¶
type IPPoolStatus struct { // IP allocations for Nodes Allocations []Allocation `json:"allocations"` }
IPPoolStatus contains the IP ranges allocated to nodes
func (*IPPoolStatus) DeepCopy ¶
func (in *IPPoolStatus) DeepCopy() *IPPoolStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPoolStatus.
func (*IPPoolStatus) DeepCopyInto ¶
func (in *IPPoolStatus) DeepCopyInto(out *IPPoolStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Route ¶ added in v0.3.0
type Route struct { // The destination of the route, in CIDR notation Dst string `json:"dst"` }
Route contains static route parameters
func (*Route) DeepCopy ¶ added in v0.3.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.
func (*Route) DeepCopyInto ¶ added in v0.3.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.