Skip to content
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

[ACM-16286]: Ensure MCO spec addon options are propagated correctly #1718

Merged
merged 14 commits into from
Dec 16, 2024

Conversation

saswatamcode
Copy link
Member

@saswatamcode saswatamcode commented Dec 10, 2024

Turns out there are a few issues with the behavior of the ObservabilityAddon CRD.

The CRD should operationally be doing the following,

  • Have a sane default for the options, all of which it will inherit from the MCO obsAddon spec at the start
  • Be per-cluster configurable, so that the user can modify the ObservabilityAddon CR in a specific spoke cluster namespace on the hub
  • Get copied over onto the spoke cluster and configure endpoint-operator
  • Allow user to switch back to MCO-based ObsservabilityAddon config if they wish to
  • All these changes are in sync in three places: ManifestWork on hub, spoke ns ObservabilityAddon CR on hub, ObservabilityAddon CR in the actual spoke cluster.

However it was not doing this correctly which led to a few issues and fields like the scrape limit or workers for metrics-collector just wouldn't work as well as couldn't be customized. So this PR addresses those issues. This PR,

  • Updates all copies of the relevant ObservabilityAddon CRD in the repo (in both mco and endpoint-operator), to include all of the options that have been added to it
  • Make sure Placementrule Controller reconciles the ObservabilityAddon CR between spoke ns and ManifestWork correctly on changes to fields and annotations as well as status changes.
  • Add an annotation to the ObservabilityAddon CR observability.open-cluster-management.io/addon-source during the creation of the ObservabilityAddon CR and maintain it for the lifecycle. It will have two accepted values "mco" and "override". When set to "mco" it will always reflect spec from MCO CR. If you try to change it, it will reconcile back to those values. When set to "override", we will not update the ObservabilityAddon CRD and will only use found values. This basically means user can set it to whatever they want, for a particular cluster
  • If user deletes ObservabilityAddon CR, it will revert back to default with "mco" addon-source again

Copy link
Contributor

@philipgough philipgough left a comment

Choose a reason for hiding this comment

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

/lgtm

@saswatamcode
Copy link
Member Author

/hold

@openshift-ci openshift-ci bot removed the lgtm label Dec 10, 2024
@saswatamcode
Copy link
Member Author

/retest

@saswatamcode
Copy link
Member Author

/retest

Signed-off-by: Saswata Mukherjee <[email protected]>
addon.Spec.Workers = found.Spec.Workers
addon.Spec.Resources = found.Spec.Resources

addon.Annotations[addonSourceAnnotation] = "override"
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above? we wouldnt fall in here unless this k,v was already set?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a new copy, but yeah we can just copy over from found.

Copy link
Contributor

@thibaultmg thibaultmg left a comment

Choose a reason for hiding this comment

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

Looks good overall! It always surprises me that we discover those kind of bugs so late... Waiting for your replies

Signed-off-by: Saswata Mukherjee <[email protected]>
@saswatamcode
Copy link
Member Author

/retest

1 similar comment
@saswatamcode
Copy link
Member Author

/retest

Copy link
Contributor

@thibaultmg thibaultmg left a comment

Choose a reason for hiding this comment

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

/lgtm

@saswatamcode
Copy link
Member Author

/retest

@openshift-ci openshift-ci bot removed the lgtm label Dec 16, 2024
@saswatamcode
Copy link
Member Author

/test test-e2e

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
67.4% Coverage on New Code (required ≥ 70%)

See analysis details on SonarQube Cloud

Copy link

openshift-ci bot commented Dec 16, 2024

@saswatamcode: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/sonarcloud 54401ec link false /test sonarcloud

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@saswatamcode
Copy link
Member Author

/hold cancel

@coleenquadros
Copy link
Contributor

/lgtm

Copy link

openshift-ci bot commented Dec 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: coleenquadros, philipgough, saswatamcode, thibaultmg

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:
  • OWNERS [coleenquadros,philipgough,saswatamcode,thibaultmg]

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

@openshift-merge-bot openshift-merge-bot bot merged commit 8755dbd into stolostron:main Dec 16, 2024
15 of 16 checks passed
saswatamcode added a commit to saswatamcode/multicluster-observability-operator that referenced this pull request Dec 16, 2024
…tolostron#1718)

* [ACM-16286]: Ensure MCO spec addon options are propagated correctly

Signed-off-by: Saswata Mukherjee <[email protected]>

* [ACM-16286]: Update all observabilityaddon manifests

Signed-off-by: Saswata Mukherjee <[email protected]>

* [ACM-16286]: Ensure hub and spoke obsaddon are synced based on spec

Signed-off-by: Saswata Mukherjee <[email protected]>

* [ACM-16286]: Allow customizing ObsAddon in spoke ns

Signed-off-by: Saswata Mukherjee <[email protected]>

* [ACM-16286]: Comments

Signed-off-by: Saswata Mukherjee <[email protected]>

* Add addon source annotation

Signed-off-by: Saswata Mukherjee <[email protected]>

* Add handling for empty map

Signed-off-by: Saswata Mukherjee <[email protected]>

* Add handling for nil maps

Signed-off-by: Saswata Mukherjee <[email protected]>

* Add annotation predicate, update in mco mode

Signed-off-by: Saswata Mukherjee <[email protected]>

* Fix unit test, make addon annotation constant

Signed-off-by: Saswata Mukherjee <[email protected]>

* Update comment

Signed-off-by: Saswata Mukherjee <[email protected]>

* Address comments

Signed-off-by: Saswata Mukherjee <[email protected]>

* Use semantic deepequal, add test for setter

Signed-off-by: Saswata Mukherjee <[email protected]>

* Set spoke addon correctly after comparison

Signed-off-by: Saswata Mukherjee <[email protected]>

---------

Signed-off-by: Saswata Mukherjee <[email protected]>
saswatamcode added a commit that referenced this pull request Dec 17, 2024
…1718) (#1725)

* [ACM-16286]: Ensure MCO spec addon options are propagated correctly



* [ACM-16286]: Update all observabilityaddon manifests



* [ACM-16286]: Ensure hub and spoke obsaddon are synced based on spec



* [ACM-16286]: Allow customizing ObsAddon in spoke ns



* [ACM-16286]: Comments



* Add addon source annotation



* Add handling for empty map



* Add handling for nil maps



* Add annotation predicate, update in mco mode



* Fix unit test, make addon annotation constant



* Update comment



* Address comments



* Use semantic deepequal, add test for setter



* Set spoke addon correctly after comparison



---------

Signed-off-by: Saswata Mukherjee <[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