Skip to content

Add OpenStack OLM subscription configurations #537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sathlan
Copy link
Contributor

@sathlan sathlan commented Apr 8, 2025

Ability to install a specific version of the operator(s) when multiple
versions are available in the OLM catalog.

Added new kustomization files and YAML configurations for OpenStack
operator subscriptions using OLM. This includes catalog sources,
namespaces, and operator groups for openstack-operators, as well as
subscription definitions for the OpenStack components when the version
is below v1.0.7.

Kustomization facilitates version-specific configurations starting
with v1.0.3 and v1.0.6, incorporating modifications like the
elimination of the AnsibleEE operator in subsequent versions. From
version 1.0.7 onwards, only the OpenStack operator is retained.

For each overlay we define the same set of ConfigMap that reach a set
of relevant parameter in the subscriptions and catalog source
definitions.

An unexpected mechanism here is that we override the
common/olm-subscriptions/kustomization.yaml file from ci-framework
for version v1.0.3 and v1.0.6. This enables the dynamic selection
of the right overlay. For version v1.0.7 and beyond we used the
default overlay and we don't need to overwrite the kustomization
file.

The problems that we cannot solve with just parameters are:

  • v1.0.3 and v1.0.6 have a different set of subscriptions to
    include
  • startingCSV parameter is "dynamic" as it's composed of the
    spec.name.version, not just version. Thus we cannot encode in a
    kustomize parameter without create our own transformer. As
    transformwer are not deployed here, it would be too much work to
    boostrap it.

All this disapear starting with v1.0.7 where we have only one
subscription to set.

Resolves-Part-Of: OSPRH-15056

- v1.0.6: this version no longer includes the AnsibleEE operator
- v1.0.7 and later: these versions only include the OpenStack operator

Refer to the `ci_gen_kustomize_values` role README for configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to provide a link to CIFMW if we're going to reference it, though I am a bit wary of pointing in that direction since the dependency is the other way around and we haven't explicitly mentioned CIFMW in this repo yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually ci_gen_kustomize_values is one "hardcoded" way to interact with this (as it is for examples/common/olm/) and it took me some time to get it. From a roocky point of view it makes sense to explicititely set the relation between the two, but I might miss something. Now, I get that maybe such pointer shouldn't be explicit in there. So let me know when you've set your mind, and I'll either add a proper link, or just remove that line entirely.

@@ -0,0 +1,6 @@
---
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main difference relative to to examples/common/olm/ is that the kustomization.yml can be overwritten as well in order to select the right overlay . I didn't find a way to make this a paramater that can be passed down to kustomize, so I re-use the values.yml mechanism (ie overwritting file) to create the kustomization.yaml file as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally assume that the various values.yaml ConfigMaps are the interface by which the user customizes the VAs/DTs. If they're modifying the kustomization.yamls, then technically they aren't using the repo as intended. So looking at the new examples/common/olm-subscriptions, I'm not sure why you couldn't just add your new values.yaml fields/values to the existing values.yaml [1] and then modify the kustomization.yaml [2] to inject them. Perhaps I am missing something though.

[1] https://github.com/openstack-k8s-operators/architecture/blob/main/examples/common/olm/values.yaml
[2] https://github.com/openstack-k8s-operators/architecture/blob/main/lib/olm-openstack/kustomization.yaml

Copy link
Contributor Author

@sathlan sathlan Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the problem is twofold here:

  • the list of subscription to create is different from version to version: 1.0.3 has ansiibleee subscription, but 1.0.6 doesn't. That mean that the kustomization cannot include always the same list of files;
  • the startingCSV value need to be <operator subscription name>.<version>, making it "dynamic" is it's different for every subscription. Having overlays enable kustomize to take this into account. But then we must choose the right overlay, hence the need to overwrite kustomization.yaml

Starting with v1.0.7 everything is simpler and the kustomization.yaml overwrite doesn't happen anymore (we just use the default overlay). Furthermore, we can just use the values.yaml to populate the startingCSV of the openstack-operator to openstack-operator.<version> as it's the only subscription to edit.

To summarize, this is only needed for 1.0.3 and 1.0.6 and because their number of subscriptions is more than one and they are differents for each of them.

Does it make sense ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I see what your concern is now. I need to think about it some more, but what you've done might be the right approach for now at least.

@sathlan sathlan marked this pull request as draft April 9, 2025 10:26
@sathlan sathlan force-pushed the old_versions branch 2 times, most recently from 0c7db87 to e5deb1f Compare April 9, 2025 12:56
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 9, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

New test cases have been added using Molecule for different OpenStack
operator versions: v1.0.3, v1.0.6, and v1.0.7. Note that v1.0.7 is
designed to support all future deployments where only the
openstack-operator subscription is needed.

To assist in testing and verification within a live environment, tasks
for setting up and tearing down OpenShift CRC are provided.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
@sathlan sathlan marked this pull request as ready for review April 9, 2025 14:30
@openshift-ci openshift-ci bot requested review from cjeanner and leifmadsen April 9, 2025 14:30
@sathlan sathlan marked this pull request as draft April 9, 2025 17:21
@sathlan sathlan force-pushed the old_versions branch 3 times, most recently from d794684 to b0c5d22 Compare April 9, 2025 22:20
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 9, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 10, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
Ability to install a specific version of the operator(s) when multiple
versions are available in the OLM catalog.

Added new kustomization files and YAML configurations for OpenStack
operator subscriptions using OLM. This includes catalog sources,
namespaces, and operator groups for openstack-operators, as well as
subscription definitions for the OpenStack components when the version
is below v1.0.7.

Kustomization facilitates version-specific configurations starting
with v1.0.3 and v1.0.6, incorporating modifications like the
elimination of the AnsibleEE operator in subsequent versions. From
version 1.0.7 onwards, only the OpenStack operator is retained.

For each overlay we define the same set of ConfigMap that reach a set
of relevant parameter in the subscriptions and catalog source
definitions.

An unexpected mechanism here is that we override the
`common/olm-subscriptions/kustomization.yaml` file from ci-framework
for version `v1.0.3` and `v1.0.6`.  This enables the dynamic selection
of the right overlay.  For version `v1.0.7` and beyond we used the
default overlay and we don't need to overwrite the `kustomization`
file.

The problems that we cannot solve with just parameters are:
- `v1.0.3` and `v1.0.6` have a different set of subscriptions to
include
- `startingCSV` parameter is "dynamic" as it's composed of the
`spec.name`.`version`, not just `version`. Thus we cannot encode in a
kustomize parameter without create our own transformer. As
transformwer are not deployed here, it would be too much work to
boostrap it.

All this disapear starting with `v1.0.7` where we have only one
subscription to set.
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 10, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 10, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 11, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 11, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 11, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
@sathlan sathlan marked this pull request as ready for review April 11, 2025 11:51
@openshift-ci openshift-ci bot requested a review from abays April 11, 2025 11:51
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 11, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
sathlan added a commit to sathlan/ci-framework that referenced this pull request Apr 11, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
@abays
Copy link
Contributor

abays commented Apr 16, 2025

@sathlan invited me and others to a meeting in which he explained his reasoning for creating this PR this way. While it is somewhat regrettable to have to create something so specific and verbose, I agree with him that Kustomize constricts our options here. If this approach works for now, I am good with it. It does not impact the existing OLM deployment approach used by the VAs and DTs. @fultonj What do you think?

@fultonj
Copy link
Contributor

fultonj commented Apr 17, 2025

@sathlan invited me and others to a meeting in which he explained his reasoning for creating this PR this way. While it is somewhat regrettable to have to create something so specific and verbose, I agree with him that Kustomize constricts our options here. If this approach works for now, I am good with it. It does not impact the existing OLM deployment approach used by the VAs and DTs. @fultonj What do you think?

@abays I agree with you. I think we can merge.

Copy link
Contributor

@fultonj fultonj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

Copy link

openshift-ci bot commented Apr 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fultonj, sathlan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/3a87167538c147ceab4df0f10a9e6f68

✔️ noop SUCCESS in 0s
✔️ rhoso-architecture-validate-bgp-l3-xl SUCCESS in 5m 29s
✔️ rhoso-architecture-validate-bgp_dt01 SUCCESS in 5m 42s
✔️ rhoso-architecture-validate-bmo01 SUCCESS in 5m 26s
✔️ rhoso-architecture-validate-dcn SUCCESS in 4m 42s
✔️ rhoso-architecture-validate-hci SUCCESS in 5m 08s
✔️ rhoso-architecture-validate-hci-adoption SUCCESS in 3m 25s
✔️ rhoso-architecture-validate-nfv-ovs-dpdk-sriov-adoption SUCCESS in 3m 18s
✔️ rhoso-architecture-validate-nfv-ovs-dpdk-sriov-hci SUCCESS in 5m 23s
✔️ rhoso-architecture-validate-nova-three-cells SUCCESS in 5m 12s
✔️ rhoso-architecture-validate-osasinfra SUCCESS in 5m 07s
✔️ rhoso-architecture-validate-osasinfra-ipv6 SUCCESS in 5m 30s
✔️ rhoso-architecture-validate-ovs-dpdk SUCCESS in 5m 11s
✔️ rhoso-architecture-validate-ovs-dpdk-sriov SUCCESS in 4m 41s
✔️ rhoso-architecture-validate-ovs-dpdk-sriov-2nodesets SUCCESS in 5m 03s
✔️ rhoso-architecture-validate-pidone SUCCESS in 5m 03s
✔️ rhoso-architecture-validate-sriov SUCCESS in 4m 52s
✔️ rhoso-architecture-validate-uni01alpha SUCCESS in 5m 21s
✔️ rhoso-architecture-validate-uni01alpha-adoption SUCCESS in 4m 29s
✔️ rhoso-architecture-validate-uni02beta SUCCESS in 4m 46s
✔️ rhoso-architecture-validate-uni04delta SUCCESS in 5m 06s
✔️ rhoso-architecture-validate-uni04delta-adoption SUCCESS in 4m 27s
✔️ rhoso-architecture-validate-uni04delta-ipv6 SUCCESS in 5m 03s
✔️ rhoso-architecture-validate-uni05epsilon SUCCESS in 5m 55s
✔️ rhoso-architecture-validate-uni05epsilon-adoption SUCCESS in 4m 34s
✔️ rhoso-architecture-validate-uni06zeta SUCCESS in 5m 02s
✔️ rhoso-architecture-validate-uni06zeta-adoption SUCCESS in 4m 41s
✔️ rhoso-architecture-validate-uni07eta SUCCESS in 5m 09s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 3b90625 into openstack-k8s-operators:main Apr 17, 2025
7 checks passed
frenzyfriday pushed a commit to openstack-k8s-operators/ci-framework that referenced this pull request Apr 17, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
frenzyfriday pushed a commit to frenzyfriday/ci-framework that referenced this pull request May 5, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
@sathlan
Copy link
Contributor Author

sathlan commented May 6, 2025

/cherry-pick 18.0-fr2

@openshift-cherrypick-robot

@sathlan: new pull request created: #548

In response to this:

/cherry-pick 18.0-fr2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

frenzyfriday pushed a commit to openstack-k8s-operators/ci-framework that referenced this pull request May 8, 2025
A new parameter, `cifmw_ci_gen_kustomize_values_deployment_version`,
has been introduced for overriding OLM startingCSV values in
kustomize. This also ensures the appropriate architecture directory is
utilized and all necessary subscriptions are deployed based on the
installed version.  This eventually leverages the overlay `kustomize`
feature, hence the new `olm_subscriptions_overlay.yml` that helps set
the right overlay.

When configured, this parameter will stop the update playbook from
executing the `set_openstack_containers` role and the deployment
playbook from executing the `update_container` role. The assumption is
that OLM will be used to update any necessary operators.

Depends-On: openstack-k8s-operators/architecture#537

Resolves-Part-Of: [OSPRH-15056](https://issues.redhat.com//browse/OSPRH-15056)
softwarefactory-project-zuul bot added a commit that referenced this pull request May 12, 2025
…37-to-18.0-fr2

[18.0-fr2] Add OpenStack OLM subscription configurations

This is an automated cherry-pick of #537
/assign sathlan

Reviewed-by: Andrew Bays <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants