Skip to content

Commit

Permalink
Merge pull request #629 from wenyingd/precreate_vpc
Browse files Browse the repository at this point in the history
[CRD] Add field vpc in VPCNetworkConfiguration
  • Loading branch information
wenyingd committed Jul 12, 2024
2 parents 4bc8285 + acaab98 commit 5a85626
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ spec:
context in logs. Less than or equal to 8 characters.
maxLength: 8
type: string
vpc:
description: NSX path of the VPC the Namespace associated with. If
vpc is set, only defaultIPv4SubnetSize and defaultSubnetAccessMode
take effect, other fields are ignored.
type: string
type: object
status:
description: VPCNetworkConfigurationStatus defines the observed state
Expand Down
10 changes: 10 additions & 0 deletions build/yaml/samples/nsx_v1alpha1_vpcnetworkconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ spec:
- 172.26.0.0/16
- 172.36.0.0/16
defaultSubnetAccessMode: Private
---
# Sample to create VPCNetworkConfiguration CR using a pre-created NSX VPC.
apiVersion: nsx.vmware.com/v1alpha1
kind: VPCNetworkConfiguration
metadata:
name: vpc-network-config-with-pre-created-vpc
spec:
vpc: /orgs/default/projects/proj-1/vpcs/vpc-1
defaultIPv4SubnetSize: 28
defaultSubnetAccessMode: Private
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ type VPCNetworkConfigurationSpec struct {
// +kubebuilder:validation:MaxLength=8
// +optional
ShortID string `json:"shortID,omitempty"`
// NSX path of the VPC the Namespace associated with.
// If vpc is set, only defaultIPv4SubnetSize and defaultSubnetAccessMode
// take effect, other fields are ignored.
// +optional
VPC string `json:"vpc,omitempty"`
}

// VPCNetworkConfigurationStatus defines the observed state of VPCNetworkConfiguration
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ type VPCNetworkConfigurationSpec struct {
// +kubebuilder:validation:MaxLength=8
// +optional
ShortID string `json:"shortID,omitempty"`
// NSX path of the VPC the Namespace associated with.
// If vpc is set, only defaultIPv4SubnetSize and defaultSubnetAccessMode
// take effect, other fields are ignored.
// +optional
VPC string `json:"vpc,omitempty"`
}

// VPCNetworkConfigurationStatus defines the observed state of VPCNetworkConfiguration
Expand Down

0 comments on commit 5a85626

Please sign in to comment.