Skip to content
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

Update NetworkConfiguration CR with new VPC API #595

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

wenqiq
Copy link
Contributor

@wenqiq wenqiq commented Jun 4, 2024

Change VPCNetworkConfiguration CR, add VPCConnectivityProfile ID.

@wenqiq wenqiq force-pushed the topic/wenqi/newVPCNetworkConfiguration branch 6 times, most recently from f27b714 to e45262d Compare June 4, 2024 08:58
@wenqiq wenqiq marked this pull request as ready for review June 4, 2024 09:06
@wenqiq wenqiq changed the title [Not4review]update NetworkConfiguration CR with new VPC API Update NetworkConfiguration CR with new VPC API Jun 4, 2024
@wenqiq wenqiq force-pushed the topic/wenqi/newVPCNetworkConfiguration branch 4 times, most recently from 88264d8 to 247ef00 Compare June 21, 2024 00:26
VPCConnectivityProfile string `json:"vpcConnectivityProfile,omitempty"`

// +kubebuilder:validation:Enum=SMALL;MEDIUM;LARGE;XLARGE
LbServiceSize string `json:"lbServiceSize,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add this to VPCNetworkConfigInfo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the LB size should be only configured in VPCNetworkConfiguration CR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VPCNetworkConfigInfo is an internal struct, and it is used to store VPC config.

@wenqiq wenqiq force-pushed the topic/wenqi/newVPCNetworkConfiguration branch from f195cb8 to d8b04e8 Compare June 25, 2024 06:49
@@ -2,4 +2,6 @@
bin/
.DS_Store
go.work
go.work.sum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not submit .gitignore

@@ -43,6 +44,13 @@ require (
sigs.k8s.io/controller-runtime v0.16.0
)

require (
github.com/zhengxiexie/vsphere-automation-sdk-go/lib v0.7.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we merge this change now, or wait till new SDK ready and change it to official one?

go.mod Outdated
@@ -6,14 +6,15 @@ replace (
github.com/vmware-tanzu/nsx-operator/pkg/apis => ./pkg/apis
github.com/vmware-tanzu/nsx-operator/pkg/apis/v1alpha1 => ./pkg/apis/v1alpha1
github.com/vmware-tanzu/nsx-operator/pkg/apis/v1alpha2 => ./pkg/apis/v1alpha2
github.com/vmware-tanzu/nsx-operator/pkg/client => ./pkg/client
github.com/vmware-tanzu/nsx-operator/pkg/client => ./pkg/client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, what changed on this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space alignment

@@ -41,6 +41,7 @@ type NetworkInfoReconciler struct {
Recorder record.EventRecorder
}

// Reconcile ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this comment do?

@@ -5,7 +5,7 @@ import (
"fmt"
"reflect"

"github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model"
"github.com/zhengxiexie/vsphere-automation-sdk-go/services/nsxt/model"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible we use replace in go.mod instead of changing this import path everywhere @TaoZou1 @wenqiq

VPCConnectivityProfile string `json:"vpcConnectivityProfile,omitempty"`

// +kubebuilder:validation:Enum=SMALL;MEDIUM;LARGE;XLARGE
LbServiceSize string `json:"lbServiceSize,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the LB size should be only configured in VPCNetworkConfiguration CR

@@ -558,6 +558,15 @@ func (s *VPCService) CreateOrUpdateVPC(obj *v1alpha1.NetworkInfo) (*model.Vpc, *
return existingVPC[0], &nc, nil
}

if nc.VPCConnectivityProfile != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to create private IPBlock, you can just add private CIDR into VPC API request

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this VPCConnectivityProfile logic into buildNSXVPC?

@dantingl
Copy link
Contributor

dantingl commented Jul 1, 2024

  1. please push a separate PR for CRD definition
  2. for VPC creation, no need to create private IPBlock, just need to set private cidr in VPC body

Update sdk package

Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
Add Project type

Add const AccessModeProject Project

Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
@wenqiq
Copy link
Contributor Author

wenqiq commented Jul 1, 2024

A separate PR for CRD definition

#623

// Edge cluster path on which the networking elements will be created.
EdgeClusterPath string `json:"edgeClusterPath,omitempty"`

// NSX-T Project the Namespace associated with.
NSXTProject string `json:"nsxtProject,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NSXTProject -> "NsxProject"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VPCNetworkConfigurationSpec should be like
type VPCNetworkConfigurationSpec struct {
NsxProject
VpcConnectivityProfile
PrivateIPs
ShortID
LbServiceSize
PodSubnetAccessMode
DefaultSubnetSize
}

@wenqiq wenqiq force-pushed the topic/wenqi/newVPCNetworkConfiguration branch from d8b04e8 to 93e9662 Compare July 9, 2024 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants