From 6522fff590df4ab3bb28fa9d52f9eb94347de6c2 Mon Sep 17 00:00:00 2001 From: gran Date: Thu, 20 Jun 2024 11:03:36 +0800 Subject: [PATCH] [VPC] Add NSX LBS path to VPCInfo and use LB options in NsxConfig Signed-off-by: gran --- .../crd/nsx.vmware.com_vpcnetworkconfigurations.yaml | 4 ++++ pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go | 2 ++ pkg/config/config.go | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml b/build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml index 23b96a849..9b2f23dde 100644 --- a/build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml +++ b/build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml @@ -112,6 +112,10 @@ spec: name: description: VPC name. type: string + nsxlbspath: + description: NSXLBSPath is the NSX Policy path for the NSX LB + Service path. + type: string required: - name type: object diff --git a/pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go b/pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go index 9ba4babbc..6786fa54a 100644 --- a/pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go +++ b/pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go @@ -60,6 +60,8 @@ type VPCInfo struct { Name string `json:"name"` // AVISESubnetPath is the NSX Policy Path for the AVI SE Subnet. AVISESubnetPath string `json:"lbSubnetPath,omitempty"` + // NSXLBSPath is the NSX Policy path for the NSX LB Service path. + NSXLBSPath string `json:"nsxlbspath,omitempty"` } // +genclient diff --git a/pkg/config/config.go b/pkg/config/config.go index 2710b69c9..77b6f33b7 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -30,6 +30,13 @@ const ( WebhookCertDir = "/tmp/k8s-webhook-server/serving-certs" ) +const ( + LB_SERVICE_SIZE_SMALL = "SMALL" + LB_SERVICE_SIZE_MEDIUM = "MEDIUM" + LB_SERVICE_SIZE_LARGE = "LARGE" + LB_SERVICE_SIZE_XLARGE = "XLARGE" +) + var ( LogLevel int ProbeAddr, MetricsAddr string @@ -117,6 +124,10 @@ type NsxConfig struct { EnvoyHost string `ini:"envoy_host"` EnvoyPort int `ini:"envoy_port"` LicenseValidationInterval int `ini:"license_validation_interval"` + UseAVILB bool `ini:"use_avi_lb"` + UseNativeLoadBalancer *bool `ini:"use_native_loadbalancer"` + RelaxScaleValidaion bool `ini:"relax_scale_validation"` + ServiceSize string `ini:"service_size"` } type K8sConfig struct {