Skip to content

CAPO: reuse a pre-existing IP for cluster_virtual_ip

Alexandre Seitz requested to merge aseitz/capo_fixed_vip into main

What does this MR do and why?

In CAPO context, allow to use a pre-existing Virtual IP (Neutron PORT manually reserved) as the cluster_virtual_ip instead of relying on Heat Stack Operator which retrieves an IP dynamically.

Also, we remove the default value 55.55.55.55 and repace it by an empty string.

The idea, if .cluster_virtual_ip is different from the default value "" we consider it as a pre-existing IP.

We add an extra kustomize-unit capo-get-existing-resources:

  • to check if IP specified in .cluster_virtual_ip exists already in Openstack Cloud and belongs to .cluster.capo.network_id
  • and we retrieve the corresponding UUID and save it in a ConfigMap os-existing-resources-info

We add an extra _internal value _internal.cluster_virtual_ip to save the resulting VIP from:

  • either IP provided dynamically by Heat Operator
  • or IP provided by end-user (fixed Openstack VIP)
  • or copy of .cluster_virtual_ip for others cases (baremetal ...)

This is done in order to avoid loop reconciliation (before this change when capo-cluster-resources reconciliates, it patches the values.cluster_virtual_ip which trigger a reconciliation of capo-get-existing-resources unit ...), now HelmRelease will override .Values._internal.cluster_virtual_ip instead of .Values.cluster_virtual_ip

Notice if the IP doesn't exist in Openstack Cloud, this step will fail, we consider it as a fatal error, and deployment will fail.

In kustomize-unit capo-cluster-resources (in charge of HEAT Stack):

  • we reuse the port UUID (if exists in os-existing-resources-info) to configure correctly the floating-IP if required
  • in this case, we configure a new Neutron resource floating-ip-association by specifying the UUID of the Neutron port matching the manually created VIP

Related reference(s)

closes #1189 (closed)

Test coverage

With an existing PORT in Openstack on the same NETWORK than .cluster.capo.network_id :

  • deployment of management cluster with 3 CP with specifying an existing Cluster Virtual IP: OK
  • deployment of management cluster with 3 CP with external_network (FIP) + specifying an existing Cluster Virtual IP : OK
Edited by Alexandre Seitz

Merge request reports