Skip to content

Commit c58ca30

Browse files
authored
Adjust ALB Settings configuration to support IPv6 and Transparent mode (#549)
1 parent 687a663 commit c58ca30

File tree

5 files changed

+43
-7
lines changed

5 files changed

+43
-7
lines changed

.changes/v2.20.0/549-improvements.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* NSX-T ALB settings for Edge Gateway gain support for IPv6 service network definition (VCD 10.4.0+)
2+
and Transparent mode (VCD 10.4.1+) by adding new fields to `types.NsxtAlbConfig` and automatically
3+
elevating API up to 37.1 [GH-549]

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These owners will be the default owners for everything in the repo. Unless a later match takes
22
# precedence all these users will be requested for review when someone opens a pull request.
3-
* @lvirbalas @Didainius @adambarreiro @dataclouder
3+
* @lvirbalas @Didainius @adambarreiro @dataclouder @adezxc

govcd/nsxt_alb_settings_test.go

+23-1
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,32 @@ func (vcd *TestVCD) Test_UpdateAlbSettings(check *C) {
6969
check.Assert(enabledSettingsCustomServiceDefinition.Enabled, Equals, true)
7070
check.Assert(enabledSettingsCustomServiceDefinition.ServiceNetworkDefinition, Equals, "93.93.11.1/25")
7171

72-
// Disable ALB on Edge Gateway again and ensure it was disabled
72+
// Disable ALB on Edge Gateway
7373
err = edge.DisableAlb()
7474
check.Assert(err, IsNil)
7575

76+
// Enable IPv6 service network definition (VCD 10.4.0+)
77+
if vcd.client.Client.APIVCDMaxVersionIs(">= 37.0") {
78+
printVerbose("Enabling IPv6 service network definition for VCD 10.4.0+\n")
79+
albSettingsConfig.Ipv6ServiceNetworkDefinition = "2001:0db8:85a3:0000:0000:8a2e:0370:7334/120"
80+
enabledSettingsIpv6ServiceDefinition, err := edge.UpdateAlbSettings(albSettingsConfig)
81+
check.Assert(err, IsNil)
82+
check.Assert(enabledSettingsIpv6ServiceDefinition.Ipv6ServiceNetworkDefinition, Equals, "2001:0db8:85a3:0000:0000:8a2e:0370:7334/120")
83+
err = edge.DisableAlb()
84+
check.Assert(err, IsNil)
85+
}
86+
87+
// Enable Transparent mode (VCD 10.4.1+)
88+
if vcd.client.Client.APIVCDMaxVersionIs(">= 37.1") {
89+
printVerbose("Enabling Transparent mode for VCD 10.4.1+\n")
90+
albSettingsConfig.TransparentModeEnabled = takeBoolPointer(true)
91+
enabledSettingsTransparentMode, err := edge.UpdateAlbSettings(albSettingsConfig)
92+
check.Assert(err, IsNil)
93+
check.Assert(*enabledSettingsTransparentMode.TransparentModeEnabled, Equals, true)
94+
err = edge.DisableAlb()
95+
check.Assert(err, IsNil)
96+
}
97+
7698
albSettings, err := edge.GetAlbSettings()
7799
check.Assert(err, IsNil)
78100
check.Assert(albSettings, NotNil)

govcd/openapi_endpoints.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ var endpointMinApiVersions = map[string]string{
8282
types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointVdcNetworkProfile: "36.0", // VCD 10.3+
8383
}
8484

85-
// elevateNsxtNatRuleApiVersion helps to elevate API version to consume newer NSX-T NAT Rule features
86-
// API V35.2+ supports new fields FirewallMatch and Priority
87-
// API V36.0+ supports new RuleType - REFLEXIVE
88-
8985
// endpointElevatedApiVersions endpoint elevated API versions
9086
var endpointElevatedApiVersions = map[string][]string{
9187
types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointNsxtNatRules: {
@@ -121,7 +117,8 @@ var endpointElevatedApiVersions = map[string][]string{
121117
},
122118
types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointAlbEdgeGateway: {
123119
//"35.0", // Basic minimum required version
124-
"37.0", // Deprecates LicenseType in favor of SupportedFeatureSet
120+
"37.0", // Deprecates LicenseType in favor of SupportedFeatureSet. Adds IPv6 service network definition support
121+
"37.1", // Adds support for Transparent Mode
125122
},
126123
types.OpenApiPathVersion1_0_0 + types.OpenApiEndpointVdcNetworkProfile: {
127124
//"36.0", // Introduced support

types/v56/nsxt_types.go

+14
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,20 @@ type NsxtAlbConfig struct {
879879
// must be 25. If nothing is set, the default is 192.168.255.1/25. Default CIDR can be configured. This field cannot
880880
// be updated.
881881
ServiceNetworkDefinition string `json:"serviceNetworkDefinition,omitempty"`
882+
883+
// The IPv6 network definition in Gateway CIDR format which will be used by Load Balancer
884+
// service on Edge. All the load balancer service engines associated with the Service Engine
885+
// Group will be attached to this network.
886+
// Once set, this field cannot be updated. The default
887+
// IPv4 service network will be used if both the serviceNetworkDefinition and
888+
// ipv6ServiceNetworkDefinition properties are unset. If both are set, it will still be one
889+
// service network with a dual IPv4 and IPv6 stack.
890+
// This field is only available for VCD 10.4.0+ (v37.0+)
891+
Ipv6ServiceNetworkDefinition string `json:"ipv6ServiceNetworkDefinition,omitempty"`
892+
893+
// TransparentModeEnabled allows to configure Preserve Client IP on a Virtual Service
894+
// This field is only available for VCD 10.4.1+ (v37.1+)
895+
TransparentModeEnabled *bool `json:"transparentModeEnabled,omitempty"`
882896
}
883897

884898
// NsxtAlbServiceEngineGroupAssignment configures Service Engine Group assignments to Edge Gateway. The only mandatory

0 commit comments

Comments
 (0)