Skip to content

Commit

Permalink
[VPC] Add NSX LBS path to VPCInfo and use LB options in NsxConfig
Browse files Browse the repository at this point in the history
Signed-off-by: gran <gran@vmware.com>
  • Loading branch information
gran-vmv committed Jun 20, 2024
1 parent fd0eb5a commit db39a20
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ 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"`
}

type K8sConfig struct {
Expand Down Expand Up @@ -189,6 +191,7 @@ func LoadConfigFromFile() (*NSXOperatorConfig, error) {
if err != nil {
return nil, err
}
nsxOperatorConfig.NsxConfig.UseNativeLoadBalancer = cfg.Section("nsx_v3").Key("use_native_loadbalancer").MustBool(true)
err = cfg.Section("k8s").MapTo(nsxOperatorConfig.K8sConfig)
if err != nil {
return nil, err
Expand Down

0 comments on commit db39a20

Please sign in to comment.