Skip to content

Commit 28401d0

Browse files
Merge pull request openshift#8497 from shiftstack/do-not-use-trunk
OSASINFRA-3456: OpenStack: do not use trunk for the Machines by default
2 parents d6fa028 + 3f8660f commit 28401d0

File tree

11 files changed

+29
-80
lines changed

11 files changed

+29
-80
lines changed

data/data/install.openshift.io_installconfigs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3984,7 +3984,8 @@ spec:
39843984
trunkSupport:
39853985
description: 'TrunkSupport holds a `0` or `1` value that indicates
39863986
whether or not to use trunk ports in your OpenShift cluster.
3987-
Deprecated: this value is set by the installer automatically.'
3987+
Deprecated: the machine manifest should be used to specify that
3988+
trunk should be used.'
39883989
type: string
39893990
required:
39903991
- cloud

data/data/openstack/masters/private-network.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,6 @@ resource "openstack_networking_port_v2" "ingress_port" {
156156
}
157157
}
158158

159-
resource "openstack_networking_trunk_v2" "masters" {
160-
name = "${var.cluster_id}-master-trunk-${count.index}"
161-
count = var.openstack_trunk_support ? var.master_count : 0
162-
description = local.description
163-
tags = ["openshiftClusterID=${var.cluster_id}"]
164-
165-
admin_state_up = "true"
166-
port_id = openstack_networking_port_v2.masters[count.index].id
167-
}
168-
169159
// If external network is defined, assign the floating IP to one of the masters.
170160
//
171161
// Strictly speaking, this is not required to finish the installation. We

data/data/openstack/variables-openstack.tf

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -317,18 +317,8 @@ variable "openstack_master_flavor_name" {
317317
description = "Instance size for the master node(s). Example: `m1.medium`."
318318
}
319319

320-
variable "openstack_trunk_support" {
321-
type = bool
322-
default = false
323-
324-
description = <<EOF
325-
False if the OpenStack Neutron trunk extension is disabled and True if it is enabled.
326-
EOF
327-
328-
}
329-
330320
variable "openstack_octavia_support" {
331-
type = bool
321+
type = bool
332322
default = false
333323

334324
description = <<EOF
@@ -338,69 +328,69 @@ EOF
338328
}
339329

340330
variable "openstack_master_server_group_name" {
341-
type = string
331+
type = string
342332
description = "Name of the server group for the master nodes."
343333
}
344334

345335
variable "openstack_master_server_group_policy" {
346-
type = string
336+
type = string
347337
description = "Policy of the server group for the master nodes."
348338
}
349339

350340
variable "openstack_default_machines_port" {
351341
type = object({
352342
network_id = string
353343
fixed_ips = list(object({
354-
subnet_id = string
344+
subnet_id = string
355345
ip_address = string
356346
}))
357347
})
358-
default = null
348+
default = null
359349
description = "The masters' default control-plane port. If empty, the installer will create a new network."
360350
}
361351

362352
variable "openstack_machines_ports" {
363353
type = list(object({
364354
network_id = string
365355
fixed_ips = list(object({
366-
subnet_id = string
356+
subnet_id = string
367357
ip_address = string
368358
}))
369359
}))
370360
description = "The control-plane port for each machine. If null, the default is used."
371-
default = [null, null, null]
361+
default = [null, null, null]
372362
}
373363

374364
variable "openstack_master_availability_zones" {
375-
type = list(string)
376-
default = [""]
365+
type = list(string)
366+
default = [""]
377367
description = "List of availability Zones to Schedule the masters on."
378368
}
379369

380370
variable "openstack_master_root_volume_availability_zones" {
381-
type = list(string)
382-
default = [""]
371+
type = list(string)
372+
default = [""]
383373
description = "List of availability Zones to Schedule the masters root volumes on."
384374
}
385375

386376
variable "openstack_master_root_volume_types" {
387-
type = list(string)
388-
default = [""]
377+
type = list(string)
378+
default = [""]
389379
description = "List of volume types used by the masters root volumes."
390380
}
391381

392382
variable "openstack_worker_server_group_names" {
393-
type = set(string)
394-
default = []
383+
type = set(string)
384+
default = []
395385
description = "Names of the server groups for the worker nodes."
396386
}
397387

398388
variable "openstack_worker_server_group_policy" {
399-
type = string
389+
type = string
400390
description = "Policy of the server groups for the worker nodes."
401391
}
402392

403393
variable "openstack_user_managed_load_balancer" {
404-
type = bool
394+
type = bool
405395
description = "True if the load balancer that is used for the control plane VIPs is managed by the user."
406396
}

pkg/asset/machines/clusterapi.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,6 @@ func (c *ClusterAPI) Generate(dependencies asset.Parents) error {
389389
pool.Platform.OpenStack = &mpool
390390

391391
imageName, _ := rhcosutils.GenerateOpenStackImageName(string(*rhcosImage), clusterID.InfraID)
392-
trunkSupport, err := openstack.CheckNetworkExtensionAvailability(
393-
ic.Platform.OpenStack.Cloud,
394-
"trunk",
395-
nil,
396-
)
397-
if err != nil {
398-
return fmt.Errorf("failed to check for trunk support: %w", err)
399-
}
400392

401393
for _, role := range []string{"master", "bootstrap"} {
402394
openStackMachines, err := openstack.GenerateMachines(
@@ -405,7 +397,6 @@ func (c *ClusterAPI) Generate(dependencies asset.Parents) error {
405397
&pool,
406398
imageName,
407399
role,
408-
trunkSupport,
409400
)
410401
if err != nil {
411402
return fmt.Errorf("failed to create machine objects: %w", err)

pkg/asset/machines/master.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,7 @@ func (m *Master) Generate(dependencies asset.Parents) error {
331331

332332
imageName, _ := rhcosutils.GenerateOpenStackImageName(string(*rhcosImage), clusterID.InfraID)
333333

334-
trunkSupport, err := openstack.CheckNetworkExtensionAvailability(
335-
ic.Platform.OpenStack.Cloud,
336-
"trunk",
337-
nil,
338-
)
339-
if err != nil {
340-
return fmt.Errorf("failed to check for trunk support: %w", err)
341-
}
342-
machines, controlPlaneMachineSet, err = openstack.Machines(clusterID.InfraID, ic, &pool, imageName, "master", masterUserDataSecretName, trunkSupport)
334+
machines, controlPlaneMachineSet, err = openstack.Machines(clusterID.InfraID, ic, &pool, imageName, "master", masterUserDataSecretName)
343335
if err != nil {
344336
return fmt.Errorf("failed to create master machine objects: %w", err)
345337
}

pkg/asset/machines/openstack/machines.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const (
3535
)
3636

3737
// Machines returns a list of machines for a machinepool.
38-
func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, userDataSecret string, trunkSupport bool) ([]machineapi.Machine, *machinev1.ControlPlaneMachineSet, error) {
38+
func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, userDataSecret string) ([]machineapi.Machine, *machinev1.ControlPlaneMachineSet, error) {
3939
if configPlatform := config.Platform.Name(); configPlatform != openstack.Name {
4040
return nil, nil, fmt.Errorf("non-OpenStack configuration: %q", configPlatform)
4141
}
@@ -61,7 +61,6 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine
6161
osImage,
6262
role,
6363
userDataSecret,
64-
trunkSupport,
6564
failureDomain,
6665
)
6766
if err != nil {
@@ -99,7 +98,6 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine
9998
osImage,
10099
role,
101100
userDataSecret,
102-
trunkSupport,
103101
machinev1.OpenStackFailureDomain{RootVolume: &machinev1.RootVolume{}},
104102
)
105103
if err != nil {
@@ -159,7 +157,7 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine
159157
return machines, controlPlaneMachineSet, nil
160158
}
161159

162-
func generateProviderSpec(clusterID string, platform *openstack.Platform, mpool *openstack.MachinePool, osImage string, role, userDataSecret string, trunkSupport bool, failureDomain machinev1.OpenStackFailureDomain) (*machinev1alpha1.OpenstackProviderSpec, error) {
160+
func generateProviderSpec(clusterID string, platform *openstack.Platform, mpool *openstack.MachinePool, osImage string, role, userDataSecret string, failureDomain machinev1.OpenStackFailureDomain) (*machinev1alpha1.OpenstackProviderSpec, error) {
163161
var controlPlaneNetwork machinev1alpha1.NetworkParam
164162
additionalNetworks := make([]machinev1alpha1.NetworkParam, 0, len(mpool.AdditionalNetworkIDs))
165163
primarySubnet := ""
@@ -249,7 +247,7 @@ func generateProviderSpec(clusterID string, platform *openstack.Platform, mpool
249247
AvailabilityZone: failureDomain.AvailabilityZone,
250248
SecurityGroups: securityGroups,
251249
ServerGroupName: serverGroupName,
252-
Trunk: trunkSupport,
250+
Trunk: false,
253251
Tags: []string{
254252
fmt.Sprintf("openshiftClusterID=%s", clusterID),
255253
},

pkg/asset/machines/openstack/machinesets.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const maxInt32 int64 = int64(^uint32(0)) >> 1
2424
// availability zones, Storage availability zones and Root volume types), when
2525
// more than one is specified, values of identical index are grouped in the
2626
// same MachineSet.
27-
func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, userDataSecret string, trunkSupport bool) ([]*clusterapi.MachineSet, error) {
27+
func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, userDataSecret string) ([]*clusterapi.MachineSet, error) {
2828
if configPlatform := config.Platform.Name(); configPlatform != openstack.Name {
2929
return nil, fmt.Errorf("non-OpenStack configuration: %q", configPlatform)
3030
}
@@ -65,7 +65,6 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach
6565
osImage,
6666
role,
6767
userDataSecret,
68-
trunkSupport,
6968
failureDomains[idx],
7069
)
7170
if err != nil {

pkg/asset/machines/openstack/openstackmachines.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
)
2020

2121
// GenerateMachines returns manifests and runtime objects to provision the control plane (including bootstrap, if applicable) nodes using CAPI.
22-
func GenerateMachines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role string, trunkSupport bool) ([]*asset.RuntimeFile, error) {
22+
func GenerateMachines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role string) ([]*asset.RuntimeFile, error) {
2323
if configPlatform := config.Platform.Name(); configPlatform != openstack.Name {
2424
return nil, fmt.Errorf("non-OpenStack configuration: %q", configPlatform)
2525
}
@@ -44,7 +44,6 @@ func GenerateMachines(clusterID string, config *types.InstallConfig, pool *types
4444
mpool,
4545
osImage,
4646
role,
47-
trunkSupport,
4847
failureDomain,
4948
)
5049
if err != nil {
@@ -110,7 +109,7 @@ func GenerateMachines(clusterID string, config *types.InstallConfig, pool *types
110109
return result, nil
111110
}
112111

113-
func generateMachineSpec(clusterID string, platform *openstack.Platform, mpool *openstack.MachinePool, osImage string, role string, trunkSupport bool, failureDomain machinev1.OpenStackFailureDomain) (*capo.OpenStackMachineSpec, error) {
112+
func generateMachineSpec(clusterID string, platform *openstack.Platform, mpool *openstack.MachinePool, osImage string, role string, failureDomain machinev1.OpenStackFailureDomain) (*capo.OpenStackMachineSpec, error) {
114113
port := capo.PortOpts{}
115114

116115
addressPairs := populateAllowedAddressPairs(platform)
@@ -192,8 +191,7 @@ func generateMachineSpec(clusterID string, platform *openstack.Platform, mpool *
192191
Value: clusterID,
193192
},
194193
},
195-
196-
Trunk: trunkSupport,
194+
Trunk: false,
197195
Tags: []string{
198196
fmt.Sprintf("openshiftClusterID=%s", clusterID),
199197
},

pkg/asset/machines/worker.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,7 @@ func (w *Worker) Generate(dependencies asset.Parents) error {
584584

585585
imageName, _ := rhcosutils.GenerateOpenStackImageName(string(*rhcosImage), clusterID.InfraID)
586586

587-
trunkSupport, err := openstack.CheckNetworkExtensionAvailability(
588-
ic.Platform.OpenStack.Cloud,
589-
"trunk",
590-
nil,
591-
)
592-
if err != nil {
593-
return fmt.Errorf("failed to check for trunk support: %w", err)
594-
}
595-
sets, err := openstack.MachineSets(clusterID.InfraID, ic, &pool, imageName, "worker", workerUserDataSecretName, trunkSupport)
587+
sets, err := openstack.MachineSets(clusterID.InfraID, ic, &pool, imageName, "worker", workerUserDataSecretName)
596588
if err != nil {
597589
return fmt.Errorf("failed to create worker machine objects: %w", err)
598590
}

pkg/tfvars/openstack/openstack.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ func TFVars(
187187
IngressFloatingIP string `json:"openstack_ingress_floating_ip,omitempty"`
188188
APIVIPs []string `json:"openstack_api_int_ips,omitempty"`
189189
IngressVIPs []string `json:"openstack_ingress_ips,omitempty"`
190-
TrunkSupport bool `json:"openstack_trunk_support,omitempty"`
191190
OctaviaSupport bool `json:"openstack_octavia_support,omitempty"`
192191
RootVolumeSize int `json:"openstack_master_root_volume_size,omitempty"`
193192
BootstrapShim string `json:"openstack_bootstrap_shim_ignition,omitempty"`
@@ -214,7 +213,6 @@ func TFVars(
214213
IngressFloatingIP: installConfig.Config.Platform.OpenStack.IngressFloatingIP,
215214
APIVIPs: installConfig.Config.Platform.OpenStack.APIVIPs,
216215
IngressVIPs: installConfig.Config.Platform.OpenStack.IngressVIPs,
217-
TrunkSupport: masterSpecs[0].Trunk,
218216
OctaviaSupport: octaviaSupport,
219217
RootVolumeSize: rootVolumeSize,
220218
BootstrapShim: bootstrapIgn,

0 commit comments

Comments
 (0)