Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crd/multitenancy/api/v1alpha1/podnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ const (
DeviceTypeInfiniBandNIC DeviceType = "acn.azure.com/infiniband-nic"
)

// +kubebuilder:validation:Enum=Single;PrefixBlock
type SubnetAllocationMode string

const (
Single SubnetAllocationMode = "Single"
PrefixBlock SubnetAllocationMode = "PrefixBlock"
)

// PodNetworkSpec defines the desired state of PodNetwork
type PodNetworkSpec struct {
// NetworkID is the identifier for the network, e.g. vnet guid or IB network ID
Expand All @@ -62,6 +70,10 @@ type PodNetworkSpec struct {
// Deprecated - Use NetworkID
// +kubebuilder:validation:Optional
VnetGUID string `json:"vnetGUID,omitempty"`
// subnet allocation mode
// +kubebuilder:validation:Optional
// +kubebuilder:default=Single
SubnetAllocationMode SubnetAllocationMode `json:"subnetAllocationMode,omitempty"`
}

// Status indicates the status of PN
Expand All @@ -80,6 +92,9 @@ type PodNetworkStatus struct {
// +kubebuilder:validation:Optional
Status Status `json:"status,omitempty"`
AddressPrefixes []string `json:"addressPrefixes,omitempty"`
// PrefixBlockAllocationSize indicates the size of IP block allocated to the subnet
// +kubebuilder:default=16
PrefixBlockAllocationSize int `json:"prefixBlockAllocationSize,omitempty"`
}

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ spec:
description: NetworkID is the identifier for the network, e.g. vnet
guid or IB network ID
type: string
subnetAllocationMode:
default: Single
description: subnet allocation mode
enum:
- Single
- PrefixBlock
type: string
subnetGUID:
description: customer subnet guid
type: string
Expand All @@ -94,6 +101,11 @@ spec:
items:
type: string
type: array
prefixBlockAllocationSize:
default: 16
description: PrefixBlockAllocationSize indicates the size of IP block
allocated to the subnet
type: integer
status:
description: Status indicates the status of PN
enum:
Expand Down
Loading