1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-06 18:47:19 +01:00

74 Commits

Author SHA1 Message Date
Pierre Prinetti
42e471ee57 openstack: Update Gophercloud to v2 2024-06-18 10:39:56 +02:00
Maysa Macedo
3f8660f100 OpenStack: do not use trunk for the Machines by default
As Kuryr is removed the creation of trunks for the machines
is not a requirement anymore. To reduce the amount of
resources we manage by default, let's avoid creating it as is
not a requirement. This commit will disable trunk creation by default
and let the user enable trunk by modifying the generated Machine manifests.
Also, the terraform support for creation of Machines with Trunk is being
removed.
2024-05-29 13:27:58 -03:00
Pierre Prinetti
25c0a610f2 openstack: Create server groups in the CAPI flow
CAPO doesn't create server groups; it needs the server groups referred
to in Machines to be created in the PreProvision hook.
2024-04-26 11:45:36 +02:00
Maysa Macedo
52ed219a4a openstack: Run preprovision steps for CAPI
Co-Authored-By: Pierre Prinetti <pierreprinetti@redhat.com>
Co-Authored-By: Martin André <m.andre@redhat.com>
2024-02-27 08:24:08 -03:00
Stephen Finucane
a979a0edd1 openstack: Use centralised OpenStack client
Avoid the duplication of configuring the client in multiple locations.
It also gives us a single point to start configuring a user agent for
the installer.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-10-03 11:34:02 +01:00
Emilien Macchi
a1ea1c870e openstack: Variable Root volume types
Co-Authored-By: Emilien Macchi <emilien@redhat.com>
Co-Authored-By: Pierre Prinetti <pierreprinetti@redhat.com>
2023-07-18 10:40:25 -04:00
Maysa Macedo
6df11aa509 OpenStack: Dual stack support with BYON
This commit adds dual stack support with bring your own network
for OpenStack platform. The new ControlPlanePort field accepts IPv4/IPv6
subnets and the network in the install config, while the machinesSubnet
only supports IPv4 Subnets and is deprecated.
2023-07-11 14:36:16 -03:00
Emilien Macchi
97e3019c03 openstack: remove portTargets
We introduced a TechPreview of OpenStack network failure domains in 4.13
that is now incompatible with the new control-plane-machine-set.

With this change, we remove the experimental implementation of network
failure domains to prepare for the control-plane-machine-set
implementation.

Co-Authored-By: Emilien Macchi <emilien@redhat.com>
Co-Authored-By: Pierre Prinetti <pierreprinetti@redhat.com>
2023-06-14 16:21:51 +02:00
Maysa Macedo
229feb0e72 OpenStack: support user provided dual-stack api and ingress Port
When using dual-stack installations the user needs to pre-create
the api and ingress port given OpenStack does not allow direct
assignment of addresses when using slaac/stateless, consequently
the installer can't create those. This commit adds support to tag
those Ports, assign security groups to them, attach the Floating IP
when needed and allow clean up of resources.
2023-05-15 16:35:33 +02:00
Maysa Macedo
e8a4c5248d OpenStack: support multiple API and ingress VIPs
This commit enables the usage of more than one API and ingress VIP,
which is required by Dual-Stack clusters.
2023-03-06 12:19:50 +01:00
Pierre Prinetti
4c5b601e1f OpenStack: Add Failure domains
Distribute Control plane machines across user-defined failure domains.

This feature is being release under a TechPreviewNoUpgrade FeatureSet.

Failure domains can be defined in the `controlPlane` machine-pool of
`install-config.yaml` as follows:

```yaml
controlPlane:
  name: master
  platform:
    openstack:
      type: ${CONTROL_PLANE_FLAVOR}
      failureDomains:
      - computeAvailabilityZone: 'nova-1'
        storageAvailabilityZone: 'cinder-1'
        portTargets:
        - id: storage
          network:
            id: 8db6a48e-375b-4caa-b20b-5b9a7218bfe6
      - computeAvailabilityZone: 'nova-2'
        storageAvailabilityZone: 'cinder-2'
        portTargets:
        - id: storage
          network:
            id: 39a7b82a-a8a4-45a4-ba5a-288569a6edd1
      - computeAvailabilityZone: 'nova-3'
        storageAvailabilityZone: 'cinder-3'
        portTargets:
        - id: storage
          network:
            id: 8e4b4e0d-3865-4a9b-a769-559270271242
```

Each `failureDomains` entry can take an optional
`computeAvailabilityZone` string, an optional `storageAvailabilityZone`
string, and an optional `portTargets` array.

Each `portTargets` entry requires an arbirtary `id`, which must be unique per
`failureDomain`. If `id` is exactly `control-plane`, then that
`portTarget` is used instead of the default primary subnet (or instead
of `machinesSubnet` if defined) as the first machine network.

Each `portTargets` entry takes an optional `network` object and an
optional `fixedIPs` array (not represented in the example).

The `network` object taks an optional `name` string and an optional `id`
string. `name` is ignored if `id` is passed.

Each `fixedIPs` entry takes a `subnet` object which syntax is [defined
in the `machinev1alpha1` spec as
`SubnetFilter`](d170fcdc0f/machine/v1alpha1/types_openstack.go (L230-L281)).

Note that unless an external load balancer is used, `portTargets` with
id `control-plane` must all have one single subnet and must all refer to
the same OpenStack subnet. As a consequence, the result will be similar
as setting a `machinesSubnet`, except that Compute nodes will not
follow.
2023-03-04 08:03:20 +01:00
Emilien Macchi
625932f5c3 Support for External LB as Tech Preview 2023-02-21 09:29:03 -05:00
Rafael Fonseca
ef95c1bcd4 linter: fix issues since rev 75173a17cf 2022-12-16 18:14:21 +01:00
Rafael Fonseca
80e02a974d chore: fix import order 2022-12-13 15:40:58 +01:00
Pierre Prinetti
58e265dc08 openstack: Refactor TFVars generation 2022-12-05 10:41:36 +01:00
OpenShift Merge Robot
46ebfdf721 Merge pull request #6382 from shiftstack/bump_capo
Update OpenStack spec dependencies
2022-12-05 02:02:11 -05:00
Rafael Fonseca
428688c9cd Replace deprecated io/ioutil package
`io/ioutil` has been deprecated since go-1.16 [1]. We should use `io`
and `os` instead.

[1] https://github.com/golang/go/issues/42026
2022-11-18 20:08:57 +01:00
Pierre Prinetti
f8bf57d171 Update OpenStack spec dependencies
The the OpenStack providerSpec for Machine has been moved to
openshift/api.
2022-11-11 11:33:50 +01:00
Christoph Stäbler
164d557278 Use first VIP for terraform templates
Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
2022-08-26 12:08:43 -05:00
Christoph Stäbler
a58ac55e8a Add VIPs fields for API and Ingress
Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
2022-08-26 12:08:39 -05:00
Pierre Prinetti
f6dbeccc70 openstack: Expose worker server group policy
With this change, Compute nodes within each MachineSet are automatically
created in a Server group, with a default policy of
"soft-anti-affinity".

With this change, a "serverGroupPolicy" can be set in install-config, on
the worker MachinePool and/or in the platform default.

Implements OSASINFRA-2570

Co-Authored-By: Matthew Booth <mbooth@redhat.com>
2021-10-04 18:05:15 +02:00
Pierre Prinetti
eaee6db02c openstack: Move TFVars logic to own package
This refactoring moves code from the shared `tfvars` asset directory to
the OpenStack-specific package.

The behaviour is left completely unchanged.
2021-10-02 20:56:19 +02:00
Pierre Prinetti
4a5b29ced0 openstack: Expose master server group policy
Prior to this change, the Control plane nodes are created in a server
group with the hardcoded policy "soft-anti-affinity".

This change adds a new configuration knob in the OpenStack-specific
MachinePool configuration of `install-config.yaml`.

The new property `controlPlane.platform.openstack.serverGroupPolicy`
defines the policy that will be applied to the Control Plane server
group.

Acceptable values are:

* `affinity`
* `anti-affinity`
* `soft-affinity`
* `soft-anti-affinity`

Defaults to `soft-anti-affinity`, to match the previous hardcoded
behaviour.

Validation will fail if the property is set on the Compute MachinePool.
2021-06-28 15:02:30 +02:00
Mike Fedosin
e111c469fb OpenStack: Add volume AZs to Terraform
This commit allows to generate Terraform manifests for masters
considering Root Volume availability zones.
2021-04-08 13:58:14 +02:00
Emilien Macchi
d94e816668 Bug 1945236: add proxy params to bootstrap ignition
Add Proxy config to the bootstrap ignition, so in the case of
a disconnected install using a local proxy, ignition will be able to go
through the proxy.

Co-Authored-By: @mandre
Co-Authored-By: @pierreprinetti
Signed-off-by: Emilien Macchi <emilien@redhat.com>
2021-04-08 01:34:57 -04:00
Mike Fedosin
0586d43b27 Bug 1934123: generate glance url considering the region
Now we ignore region when we generate the glance url with ignition
config. This commit updates it by considering the region name.
2021-03-11 16:49:18 +01:00
Mike Fedosin
bf052cd071 OpenStack: check if machine pool is not nil
During TFVars generation we need to check if the given machine pool
is not nil before adding additional security groups and networks.
2021-02-22 20:00:39 +01:00
Mike Fedosin
05453ef0df Bug 1813949: ignore local env variables when we create a service client
This commit explicitly disables reading auth data from env variables
by setting an invalid EnvPrefix. By doing this, we make sure that the
data from clouds.yaml is enough to authenticate.

After this change we don't have to unset OS_CLOUD env variable explicitly
anymore.

Ref https://issues.redhat.com/browse/OSASINFRA-2152
2021-01-11 13:00:11 +01:00
Emilio Garcia
42098a00c5 Set OpenStack primarySubnet in MachineSpec
In the OpenStack platform, the primary subnet is where a node's kubernetes endpoints are published.
Right now, we set this with a tag in OpenStack. Due to some users having restrictions on tagging
resources, and this being a difficult user interface, we added a way to modify this value in the
machine api. We still fully support setting this value with tagging for backwards compatibility
reasons. In this patch, we update the installer code to set the primarySubnet using the MachineSpec.
2020-12-06 17:24:44 -05:00
Adolfo Duarte
efc5c80c88 Adds clusterOSImageProperties to install-config.yaml
ClusterOSImageProperties is a list properties to be added
to the installer-uploaded ClusterOSImage in Glance.

The default is to not set any properties.

Co-Authored-By: Martin André <m.andre@redhat.com>
2020-12-04 20:45:55 +01:00
OpenShift Merge Robot
9c8baf2f69 Merge pull request #4272 from Fedosin/cleanup
Code cleanup and optimizations
2020-10-27 13:17:22 +01:00
Mike Fedosin
d8c649b250 OpenStack: remove legacy image validation
Previously we validate overriden Glance images during generation
of tfvars variables. This is not a correct place to do it, so we
implemented the check in the "validation" module:
https://github.com/openshift/installer/pull/3964

To prevent code duplication we should remove the legacy code.
2020-10-17 14:16:39 +02:00
Mike Fedosin
9162bd29bf Code cleanup and optimizations
This commit fixes issues that were found by:
`golangci-lint run pkg/... --disable-all -E gosimple -E unused`
2020-10-15 15:40:31 +02:00
Mike Fedosin
712799df0d Rename lbFloatingIP to apiFloatingIP 2020-10-07 18:15:48 +02:00
Mike Fedosin
abe0c74435 Bug 1866328: use correct cloud name for tfvars
Now we use cloud name not from the install config, which is set by
the user, but from master specs, where it is hardcoded to 'openstack'.

This patch starts using the value from the install config.
2020-08-05 13:59:17 +02:00
Emilio Garcia
ee9535732a OpenStack Availibility Zones
Following suit with AWS, OpenStack is adding support for custom AZs
for installer machine pools. Users can pass a list of zones to use
and the nodes in that machine pool will be spread across them.
2020-07-31 16:31:29 -04:00
Emilio Garcia
ecda20e348 Option to pass Floating IP for Ingress entrypoint
To make the user experience more cohesive, we are adding this feature to
allow users to pass a floating IP to be attached to the ingress port. This
mirrors the way users add the floating ip for the API port.
2020-07-16 09:56:02 -04:00
Mike Fedosin
93ac06a492 Start defining TrunkSupport and OctaviaSupport in tfvars module
Now we defining these parameters in installconfig module, and then
passing them to tvfars as a part of platform configuration.
It's better to define them in the tvfars directly.
2020-07-09 16:27:55 +02:00
OpenShift Merge Robot
5face7c5dd Merge pull request #3492 from mandre/openstack-dns-vip
Bug 1841066: OpenStack: Remove DNS VIP
2020-06-05 03:02:49 -04:00
Pierre Prinetti
91d91a0c72 openstack: Pass the master server group by name
Create the Control Plane server group in Terraform and pass the server
group by name, and not by UUID, in the machine spec.
2020-05-27 13:50:12 +02:00
Mike Fedosin
b8a19b2791 Bug 1824426: tag primary openstack network
In the case of multiple added networks the tag
<infraID>-primaryClusterNetwork should allow
cluster-api-provider-openstack to define which
IP address to set as the primary one for machines.

Now CAPO can't do this, because Neutron returns the
list of networks in alphabetical order.
2020-04-23 14:27:39 +02:00
Martin André
1aedcd8aa9 OpenStack: Remove DNS VIP
Depends on https://github.com/openshift/machine-config-operator/pull/1666
2020-04-22 10:42:57 +02:00
Emilio Garcia
588d5dadcc Add feature to enable users to pass custom subnets to use as the node subnets
Users want to re-use and customize their networking infrastructure during IPI
installs, so to enable them, we are allowing them to pass custom subnets to the
installer.
2020-04-17 10:07:43 -04:00
Mike Fedosin
5654769a4a Allow to specify additional networks and security groups 2020-04-03 20:32:45 +02:00
Mike Fedosin
beec1ab1eb OpenStack: support "file" scheme for custom image urls
Now we support http(s) schemes only, but for disconnected installs
it's very convenient to specify the local file path to the image file.

This commit adds "file" scheme support, so users can set the location as
"file:///path/to/image".
2020-03-26 22:25:55 +01:00
Pierre Prinetti
144afef3da openstack: soft-anti-affinity policy for CP
This places the Control Plane servers in a Server Group that enforces
"soft anti-affinity" policy.

"Soft anti-affinity" will cause Nova to create VMs on separate hosts, if
that is possible.

Implements OSASINFRA-1300
2020-03-18 17:50:39 +01:00
Mike Fedosin
84ab7d15e0 OpenStack: reuse the existing function to get glance public URL
Now we parse the service catalog manually, but it is better to
reuse the existing function from gophercloud, that does the same.
2020-03-12 21:43:43 +01:00
Mike Fedosin
912e7b5a8b Upload RHCOS images directly with Gophercloud
Now we use Terraform to create images in Glance. This commit starts
using direct Gophercloud calls for this.
2020-02-26 14:02:25 +01:00
Mike Fedosin
52d52b9879 Swiftless OpenStack: store bootstrap ignition configs in Glance 2020-01-22 18:39:58 +01:00
Mike Fedosin
50716afdf9 Bug 1776272: OpenStack: fix getting service catalog
We need to obtain the service catalog in several places inside the code,
but each time we expect that project_name is specified in the clouds.yaml,
and if it's not there, installation fails.
In general it's not necessary and users can specify just project_id instead
of the name.

This commit updates the service catalog downloading functions by removing
this restriction.
2019-11-27 14:54:49 +01:00