Documentation ¶
Overview ¶
Package v1 contains API Schema definitions for the networking v1 API group +kubebuilder:object:generate=true +groupName=networking.alibaba.com
Index ¶
- Constants
- Variables
- func CalculateCapacity(ar *AddressRange) int64
- func CanonicalizeIPInstance(c client.Client) (err error)
- func FetchBindingNodeName(ipInstance *IPInstance) string
- func FetchBindingPodName(ipInstance *IPInstance) string
- func GetIndexFromName(name string) int
- func IsAvailable(statistics *Count) bool
- func IsGlobalUniqueNetwork(networkObj *Network) bool
- func IsGlobalUniqueNetworkType(networkType NetworkType) bool
- func IsIPv6IPInstance(ip *IPInstance) bool
- func IsIPv6Subnet(subnet *Subnet) bool
- func IsLegacyModel(ipInstance *IPInstance) bool
- func IsPrivateSubnet(subnet *Subnet) bool
- func IsReserved(ipInstance *IPInstance) bool
- func IsSubnetAutoNatOutgoing(subnetSpec *SubnetSpec) bool
- func IsValidIPInstance(ipInstance *IPInstance) bool
- func SortIPInstancePointerSlice(in []*IPInstance)
- func ValidateAddressRange(ar *AddressRange) (err error)
- type Address
- type AddressRange
- type BGPPeer
- type Binding
- type Count
- type IPInstance
- type IPInstanceList
- type IPInstancePointerSlice
- type IPInstanceSpec
- type IPInstanceStatus
- type IPPhase
- type IPVersion
- type Network
- type NetworkConfig
- type NetworkList
- type NetworkMode
- type NetworkSpec
- type NetworkStatus
- type NetworkType
- type ObjectMeta
- type StatefulInfo
- type Subnet
- type SubnetConfig
- type SubnetList
- type SubnetSpec
- type SubnetStatus
Constants ¶
const ( IPInstanceV11 = "v1.1" IPInstanceV12 = "v1.2" IPInstanceLatestVersion = IPInstanceV12 )
const ( NetworkTypeUnderlay = NetworkType("Underlay") NetworkTypeOverlay = NetworkType("Overlay") NetworkTypeGlobalBGP = NetworkType("GlobalBGP") )
const ( NetworkModeBGP = NetworkMode("BGP") NetworkModeVlan = NetworkMode("VLAN") NetworkModeVxlan = NetworkMode("VXLAN") NetworkModeGlobalBGP = NetworkMode("GlobalBGP") )
const ( IPv4 = IPVersion("4") IPv6 = IPVersion("6") )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "networking.alibaba.com", Version: "v1"} // 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 CalculateCapacity ¶
func CalculateCapacity(ar *AddressRange) int64
func CanonicalizeIPInstance ¶ added in v0.5.0
func FetchBindingNodeName ¶ added in v0.5.0
func FetchBindingNodeName(ipInstance *IPInstance) string
func FetchBindingPodName ¶ added in v0.5.0
func FetchBindingPodName(ipInstance *IPInstance) string
func GetIndexFromName ¶ added in v0.5.0
func IsAvailable ¶ added in v0.4.0
func IsGlobalUniqueNetwork ¶ added in v0.5.0
func IsGlobalUniqueNetworkType ¶ added in v0.5.0
func IsGlobalUniqueNetworkType(networkType NetworkType) bool
func IsIPv6IPInstance ¶ added in v0.4.0
func IsIPv6IPInstance(ip *IPInstance) bool
func IsIPv6Subnet ¶
func IsLegacyModel ¶ added in v0.5.0
func IsLegacyModel(ipInstance *IPInstance) bool
IsLegacyModel will show whether IPInstance has switched to new version TODO: legacy mode, to be removed in the next major version
func IsPrivateSubnet ¶
func IsReserved ¶ added in v0.5.0
func IsReserved(ipInstance *IPInstance) bool
func IsSubnetAutoNatOutgoing ¶
func IsSubnetAutoNatOutgoing(subnetSpec *SubnetSpec) bool
func IsValidIPInstance ¶ added in v0.5.0
func IsValidIPInstance(ipInstance *IPInstance) bool
func SortIPInstancePointerSlice ¶ added in v0.6.0
func SortIPInstancePointerSlice(in []*IPInstance)
func ValidateAddressRange ¶
func ValidateAddressRange(ar *AddressRange) (err error)
Types ¶
type Address ¶
type Address struct { // +kubebuilder:validation:Required Version IPVersion `json:"version"` // +kubebuilder:validation:Required IP string `json:"ip"` // +kubebuilder:validation:Optional Gateway string `json:"gateway,omitempty"` // +kubebuilder:validation:Optional NetID *int32 `json:"netID"` // +kubebuilder:validation:Required MAC string `json:"mac"` }
func (*Address) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Address.
func (*Address) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AddressRange ¶
type AddressRange struct { // +kubebuilder:validation:Required Version IPVersion `json:"version"` // +kubebuilder:validation:Optional Start string `json:"start,omitempty"` // +kubebuilder:validation:Optional End string `json:"end,omitempty"` // +kubebuilder:validation:Required CIDR string `json:"cidr"` // +kubebuilder:validation:Optional Gateway string `json:"gateway"` // +kubebuilder:validation:Optional ReservedIPs []string `json:"reservedIPs,omitempty"` // +kubebuilder:validation:Optional ExcludeIPs []string `json:"excludeIPs,omitempty"` }
func (*AddressRange) DeepCopy ¶
func (in *AddressRange) DeepCopy() *AddressRange
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressRange.
func (*AddressRange) DeepCopyInto ¶
func (in *AddressRange) DeepCopyInto(out *AddressRange)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BGPPeer ¶ added in v0.4.0
type BGPPeer struct { // +kubebuilder:validation:Required ASN int32 `json:"asn"` // +kubebuilder:validation:Required Address string `json:"address"` // +kubebuilder:validation:Optional GracefulRestartSeconds int32 `json:"gracefulRestartSeconds,omitempty"` // +kubebuilder:validation:Optional Password string `json:"password,omitempty"` }
func (*BGPPeer) DeepCopy ¶ added in v0.4.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BGPPeer.
func (*BGPPeer) DeepCopyInto ¶ added in v0.4.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Binding ¶ added in v0.5.0
type Binding struct { // +kubebuilder:validation:Optional ReferredObject ObjectMeta `json:"referredObject,omitempty"` // +kubebuilder:validation:Optional NodeName string `json:"nodeName"` // +kubebuilder:validation:Optional PodUID types.UID `json:"podUID,omitempty"` // +kubebuilder:validation:Optional PodName string `json:"podName,omitempty"` // +kubebuilder:validation:Optional Stateful *StatefulInfo `json:"stateful,omitempty"` }
Binding defines a binding object with necessary info of an IPInstance
func (*Binding) DeepCopy ¶ added in v0.5.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Binding.
func (*Binding) DeepCopyInto ¶ added in v0.5.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Count ¶
type Count struct { // +kubebuilder:validation:Optional Total int32 `json:"total"` // +kubebuilder:validation:Optional Used int32 `json:"used"` // +kubebuilder:validation:Optional Available int32 `json:"available"` }
func (*Count) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Count.
func (*Count) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IPInstance ¶
type IPInstance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec IPInstanceSpec `json:"spec,omitempty"` Status IPInstanceStatus `json:"status,omitempty"` }
IPInstance is the Schema for the ipinstances API
func (*IPInstance) DeepCopy ¶
func (in *IPInstance) DeepCopy() *IPInstance
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPInstance.
func (*IPInstance) DeepCopyInto ¶
func (in *IPInstance) DeepCopyInto(out *IPInstance)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*IPInstance) DeepCopyObject ¶
func (in *IPInstance) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type IPInstanceList ¶
type IPInstanceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []IPInstance `json:"items"` }
IPInstanceList contains a list of IPInstance
func (*IPInstanceList) DeepCopy ¶
func (in *IPInstanceList) DeepCopy() *IPInstanceList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPInstanceList.
func (*IPInstanceList) DeepCopyInto ¶
func (in *IPInstanceList) DeepCopyInto(out *IPInstanceList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*IPInstanceList) DeepCopyObject ¶
func (in *IPInstanceList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type IPInstancePointerSlice ¶ added in v0.6.0
type IPInstancePointerSlice []*IPInstance
func (IPInstancePointerSlice) DeepCopy ¶ added in v0.7.0
func (in IPInstancePointerSlice) DeepCopy() IPInstancePointerSlice
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPInstancePointerSlice.
func (IPInstancePointerSlice) DeepCopyInto ¶ added in v0.7.0
func (in IPInstancePointerSlice) DeepCopyInto(out *IPInstancePointerSlice)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (IPInstancePointerSlice) Len ¶ added in v0.6.0
func (I IPInstancePointerSlice) Len() int
func (IPInstancePointerSlice) Less ¶ added in v0.6.0
func (I IPInstancePointerSlice) Less(i, j int) bool
func (IPInstancePointerSlice) Swap ¶ added in v0.6.0
func (I IPInstancePointerSlice) Swap(i, j int)
type IPInstanceSpec ¶
type IPInstanceSpec struct { // +kubebuilder:validation:Required Network string `json:"network"` // +kubebuilder:validation:Required Subnet string `json:"subnet"` // +kubebuilder:validation:Required Address Address `json:"address"` // +kubebuilder:validation:Optional Binding Binding `json:"binding,omitempty"` }
IPInstanceSpec defines the desired state of IPInstance
func (*IPInstanceSpec) DeepCopy ¶
func (in *IPInstanceSpec) DeepCopy() *IPInstanceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPInstanceSpec.
func (*IPInstanceSpec) DeepCopyInto ¶
func (in *IPInstanceSpec) DeepCopyInto(out *IPInstanceSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IPInstanceStatus ¶
type IPInstanceStatus struct { // +kubebuilder:validation:Optional NodeName string `json:"nodeName,omitempty"` // DEPRECATED. Planned to remove in v0.6 // +kubebuilder:validation:Optional Phase IPPhase `json:"phase,omitempty"` // +kubebuilder:validation:Optional PodName string `json:"podName,omitempty"` // +kubebuilder:validation:Optional PodNamespace string `json:"podNamespace,omitempty"` // +kubebuilder:validation:Optional SandboxID string `json:"sandboxID,omitempty"` // +kubebuilder:validation:Optional UpdateTimestamp metav1.Time `json:"updateTimestamp,omitempty"` }
IPInstanceStatus defines the observed state of IPInstance
func (*IPInstanceStatus) DeepCopy ¶
func (in *IPInstanceStatus) DeepCopy() *IPInstanceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPInstanceStatus.
func (*IPInstanceStatus) DeepCopyInto ¶
func (in *IPInstanceStatus) DeepCopyInto(out *IPInstanceStatus)
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
func (*Network) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network.
func (*Network) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Network) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type NetworkConfig ¶ added in v0.4.0
type NetworkConfig struct { // +kubebuilder:validation:Optional BGPPeers []BGPPeer `json:"bgpPeers,omitempty"` }
func (*NetworkConfig) DeepCopy ¶ added in v0.4.0
func (in *NetworkConfig) DeepCopy() *NetworkConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfig.
func (*NetworkConfig) DeepCopyInto ¶ added in v0.4.0
func (in *NetworkConfig) DeepCopyInto(out *NetworkConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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 NetworkMode ¶ added in v0.4.0
type NetworkMode string
func GetNetworkMode ¶ added in v0.4.0
func GetNetworkMode(networkObj *Network) NetworkMode
type NetworkSpec ¶
type NetworkSpec struct { // +kubebuilder:validation:Optional NodeSelector map[string]string `json:"nodeSelector,omitempty"` // +kubebuilder:validation:Optional NetID *int32 `json:"netID"` // +kubebuilder:validation:Optional // +kubebuilder:validation:Type=string Type NetworkType `json:"type,omitempty"` // +kubebuilder:validation:Optional // +kubebuilder:validation:Type=string Mode NetworkMode `json:"mode,omitempty"` // +kubebuilder:validation:Optional Config *NetworkConfig `json:"config,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 NetworkStatus ¶
type NetworkStatus struct { // +kubebuilder:validation:Optional // +kubebuilder:validation:Type=string LastAllocatedSubnet string `json:"lastAllocatedSubnet"` // +kubebuilder:validation:Optional // +kubebuilder:validation:Type=string LastAllocatedIPv6Subnet string `json:"lastAllocatedIPv6Subnet,omitempty"` // +kubebuilder:validation:Optional SubnetList []string `json:"subnetList"` // +kubebuilder:validation:Optional NodeList []string `json:"nodeList"` // +kubebuilder:validation:Optional Statistics *Count `json:"statistics"` // +kubebuilder:validation:Optional IPv6Statistics *Count `json:"ipv6Statistics,omitempty"` // +kubebuilder:validation:Optional DualStackStatistics *Count `json:"dualStackStatistics,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
func GetNetworkType ¶
func GetNetworkType(networkObj *Network) NetworkType
type ObjectMeta ¶ added in v0.5.0
type ObjectMeta struct { // +kubebuilder:validation:Required Kind string `json:"kind,omitempty"` // +kubebuilder:validation:Required Name string `json:"name,omitempty"` // +kubebuilder:validation:Optional UID types.UID `json:"uid,omitempty"` }
ObjectMeta is a short version of ObjectMeta which is pointing to an Object in specified namespace
func (*ObjectMeta) DeepCopy ¶ added in v0.5.0
func (in *ObjectMeta) DeepCopy() *ObjectMeta
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta.
func (*ObjectMeta) DeepCopyInto ¶ added in v0.5.0
func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StatefulInfo ¶ added in v0.5.0
type StatefulInfo struct {
Index *int32 `json:"index,omitempty"`
}
StatefulInfo is a collection of related info if binding to a stateful workload
func (*StatefulInfo) DeepCopy ¶ added in v0.5.0
func (in *StatefulInfo) DeepCopy() *StatefulInfo
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulInfo.
func (*StatefulInfo) DeepCopyInto ¶ added in v0.5.0
func (in *StatefulInfo) DeepCopyInto(out *StatefulInfo)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet.
func (*Subnet) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Subnet) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SubnetConfig ¶
type SubnetConfig struct { // +kubebuilder:validation:Optional GatewayType string `json:"gatewayType"` // +kubebuilder:validation:Optional GatewayNode string `json:"gatewayNode"` // +kubebuilder:validation:Optional AutoNatOutgoing *bool `json:"autoNatOutgoing"` // +kubebuilder:validation:Optional Private *bool `json:"private"` // +kubebuilder:validation:Optional AllowSubnets []string `json:"allowSubnets"` }
func (*SubnetConfig) DeepCopy ¶
func (in *SubnetConfig) DeepCopy() *SubnetConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetConfig.
func (*SubnetConfig) DeepCopyInto ¶
func (in *SubnetConfig) DeepCopyInto(out *SubnetConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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 SubnetSpec ¶
type SubnetSpec struct { // +kubebuilder:validation:Required Range AddressRange `json:"range"` // +kubebuilder:validation:Optional NetID *int32 `json:"netID"` // +kubebuilder:validation:Required Network string `json:"network"` // +kubebuilder:validation:Optional Config *SubnetConfig `json:"config"` }
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 SubnetStatus ¶
type SubnetStatus struct { // +kubebuilder:validation:Optional Count `json:",inline"` // +kubebuilder:validation:Optional LastAllocatedIP string `json:"lastAllocatedIP"` }
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.