-
Notifications
You must be signed in to change notification settings - Fork 12
[VKAL-36509] NetworkTopologyProvider CRDs #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yahhhya
wants to merge
4
commits into
master
Choose a base branch
from
topic/yc004606/VKAL-36509-networktopoprovider-crd
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| # IDEs | ||
| .vscode | ||
|
|
||
| # Binaries for programs and plugins | ||
| *.exe | ||
| *.exe~ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // Copyright (c) 2026 Broadcom. All Rights Reserved. | ||
| // Broadcom Confidential. The term "Broadcom" refers to Broadcom Inc. | ||
| // and/or its subsidiaries. | ||
|
|
||
| package v1alpha1 | ||
|
|
||
| import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
|
||
| type TypedObjectReference struct { | ||
| // APIGroup is the group for the resource being referenced. | ||
| APIGroup string `json:"apiGroup"` | ||
| // Kind is the type of resource being referenced. | ||
| Kind string `json:"kind"` | ||
| // Name is the name of resource being referenced. | ||
| Name string `json:"name"` | ||
| } | ||
|
|
||
| type NetworkTopologyType string | ||
|
|
||
| const ( | ||
| // NetworkTopologyTypeNSXT is the type for NSX Container Plugin Tier1-per-namespace network topology. | ||
| NetworkTopologyTypeNSXT NetworkTopologyType = "nsx-t" | ||
| // NetworkTopologyTypeVDS is the type for vSphere Networking topology. | ||
| NetworkTopologyTypeVDS NetworkTopologyType = "vsphere-distributed" | ||
| // NetworkTopologyTypeNSXTVPC is the type for NSX-T VPC network topology. | ||
| NetworkTopologyTypeNSXTVPC NetworkTopologyType = "nsx-t_vpc" | ||
| ) | ||
|
|
||
| type NetworkTopologyProviderSpec struct { | ||
| // Type describes type of network topology. | ||
| // +kubebuilder:validation:Enum=nsx-t;vsphere-distributed;nsx-t_vpc | ||
| Type NetworkTopologyType `json:"type"` | ||
| // ProviderRef is reference to a network topology provider object that provides the details for this type of network topology provider. | ||
| ProviderRef TypedObjectReference `json:"providerRef"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:resource:shortName=ntp,scope=Cluster | ||
|
|
||
| // NetworkTopologyProvider is the Schema for the networktopologyproviders API. | ||
| // A NetworkTopologyProvider represents a network topology provider configuration. | ||
| type NetworkTopologyProvider struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec NetworkTopologyProviderSpec `json:"spec,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| type NetworkTopologyProviderList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []NetworkTopologyProvider `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| RegisterTypeWithScheme(&NetworkTopologyProvider{}, &NetworkTopologyProviderList{}) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // Copyright (c) 2026 Broadcom. All Rights Reserved. | ||
| // Broadcom Confidential. The term "Broadcom" refers to Broadcom Inc. | ||
| // and/or its subsidiaries. | ||
|
|
||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| type NSXTNetworkTopologyProviderSpec struct { | ||
| // PodCidrs specifies the CIDR blocks for Pod networking. | ||
| PodCidrs []string `json:"podCidrs,omitempty"` | ||
| // IngressCidrs specifies the CIDR blocks for ingress traffic. | ||
| IngressCidrs []string `json:"ingressCidrs,omitempty"` | ||
| // EgressCidrs specifies the CIDR blocks for egress traffic. | ||
| EgressCidrs []string `json:"egressCidrs,omitempty"` | ||
| // ClusterDistributedSwitch is the vSphere Distributed Switch used for the cluster. | ||
| ClusterDistributedSwitch *string `json:"clusterDistributedSwitch,omitempty"` | ||
| // NsxEdgeCluster is the NSX-T Edge Cluster ID. | ||
| NsxEdgeCluster *string `json:"nsxEdgeCluster,omitempty"` | ||
| // NsxTier0Gateway is the NSX-T Tier-0 gateway path used for the Supervisor's Tier-1 gateway uplink. | ||
| NsxTier0Gateway *string `json:"nsxTier0Gateway,omitempty"` | ||
| // NamespaceSubnetPrefix is the subnet prefix size for namespaces. | ||
| NamespaceSubnetPrefix *int32 `json:"namespaceSubnetPrefix,omitempty"` | ||
| // RoutedMode indicates whether routed mode is enabled. | ||
| RoutedMode *bool `json:"routedMode,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:resource:shortName=nsxtntp,scope=Cluster | ||
|
|
||
| // NSXTNetworkTopologyProvider is the Schema for the nsxtnetworktopologyproviders API. | ||
| // A NSXTNetworkTopologyProvider represents a topology provider for NSX-T networks for a Supervisor. | ||
| type NSXTNetworkTopologyProvider struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec NSXTNetworkTopologyProviderSpec `json:"spec,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| // NSXTNetworkTopologyProviderList contains a list of NSXTNetworkTopologyProvider. | ||
| type NSXTNetworkTopologyProviderList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []NSXTNetworkTopologyProvider `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| RegisterTypeWithScheme(&NSXTNetworkTopologyProvider{}, &NSXTNetworkTopologyProviderList{}) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // Copyright (c) 2026 Broadcom. All Rights Reserved. | ||
| // Broadcom Confidential. The term "Broadcom" refers to Broadcom Inc. | ||
| // and/or its subsidiaries. | ||
|
|
||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| type NSXTVPCNetworkTopologyProviderSpec struct { | ||
| // NsxProject is the default Project for VPCs in the Supervisor, including the System VPC, and Supervisor Services | ||
| // VPC. It needs to be NSX path of Project. | ||
| NsxProject *string `json:"nsxProject,omitempty"` | ||
| // VpcConnectivityProfile is the configuration for how a VPC is constructed, including it's Transit Gateway | ||
| // Attachments, IP blocks, and other settings on NSX. It needs to be NSX path of VPC Connectivity Profile. | ||
| VpcConnectivityProfile *string `json:"vpcConnectivityProfile,omitempty"` | ||
| // DefaultPrivateCidrs specifies CIDR blocks from which private subnets are allocated. This range must not overlap | ||
| // with those in VpcConnectivityProfile, the Supervisor's Service CIDR, or other services running in the datacenter. | ||
| // You must have at least one CIDR of size 16 or larger to enable Supervisor with VPC networking. | ||
| // If Avi is used, another CIDR of size 64 is needed. | ||
| DefaultPrivateCidrs []string `json:"defaultPrivateCidrs,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:resource:shortName=nsxtvpcntp,scope=Cluster | ||
|
|
||
| // NSXTVPCNetworkTopologyProvider is the Schema for the nsxtvpcnetworktopologyproviders API. | ||
| // A NSXTVPCNetworkTopologyProvider represents a topology provider for NSX VPC networks for a Supervisor. | ||
| type NSXTVPCNetworkTopologyProvider struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec NSXTVPCNetworkTopologyProviderSpec `json:"spec,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| // NSXTVPCNetworkTopologyProviderList contains a list of NSXTVPCNetworkTopologyProvider. | ||
| type NSXTVPCNetworkTopologyProviderList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []NSXTVPCNetworkTopologyProvider `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| RegisterTypeWithScheme(&NSXTVPCNetworkTopologyProvider{}, &NSXTVPCNetworkTopologyProviderList{}) | ||
| } |
38 changes: 38 additions & 0 deletions
38
api/v1alpha1/vspheredistributednetworktopologyprovider_types.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // Copyright (c) 2026 Broadcom. All Rights Reserved. | ||
| // Broadcom Confidential. The term "Broadcom" refers to Broadcom Inc. | ||
| // and/or its subsidiaries. | ||
|
|
||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| type VSphereDistributedNetworkTopologyProviderSpec struct { | ||
| // TODO: placeholder. Unclear if anything is needed here. | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:resource:shortName=vdsntp,scope=Cluster | ||
|
|
||
| // VSphereDistributedNetworkTopologyProvider is the Schema for the vspheredistributednetworktopologyproviders API. | ||
| // A VSphereDistributedNetworkTopologyProvider represents a topology provider for vSphere distributed networks for a Supervisor. | ||
| type VSphereDistributedNetworkTopologyProvider struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec VSphereDistributedNetworkTopologyProviderSpec `json:"spec,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
||
| // VSphereDistributedNetworkTopologyProviderList contains a list of VSphereDistributedNetworkTopologyProvider. | ||
| type VSphereDistributedNetworkTopologyProviderList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []VSphereDistributedNetworkTopologyProvider `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| RegisterTypeWithScheme(&VSphereDistributedNetworkTopologyProvider{}, &VSphereDistributedNetworkTopologyProviderList{}) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.