Skip to content

ensures support for cluster-wide monitoring - #22821

Merged
vmuzikar merged 1 commit into
keycloak:mainfrom
shawkins:iss15888-next
Sep 19, 2023
Merged

ensures support for cluster-wide monitoring#22821
vmuzikar merged 1 commit into
keycloak:mainfrom
shawkins:iss15888-next

Conversation

@shawkins

Copy link
Copy Markdown
Contributor

Replaces #21231 - uses the new upstream support for quarkus.operator-sdk.generate-with-watched-namespaces

Partially addresses #15888

@shawkins

Copy link
Copy Markdown
Contributor Author

quarkiverse/quarkus-operator-sdk#658 takes the place of the ControllerConfigSourceInterceptor from the other pr.

And quarkiverse/quarkus-operator-sdk#653 / quarkiverse/quarkus-operator-sdk#654 mean that we can use the application.properties:

quarkus.operator-sdk.namespaces=JOSDK_WATCH_CURRENT
quarkus.operator-sdk.generate-with-watched-namespaces=JOSDK_WATCH_CURRENT

Instead of the individual controller workarounds.

Otherwise the rest is basically the same - the addition of a ci test for olm, making the test scripts namespaces aware, and moving the examples to test resources.

@vmuzikar
vmuzikar requested review from mabartos and vmuzikar August 31, 2023 12:07
@vmuzikar vmuzikar self-assigned this Aug 31, 2023
@vmuzikar
vmuzikar requested a review from Pepo48 August 31, 2023 12:07
@shawkins

shawkins commented Sep 7, 2023

Copy link
Copy Markdown
Contributor Author

@vmuzikar the test failure was unrelated to these changes.

@vmuzikar vmuzikar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@shawkins Sorry for the late review. Overall LGTM, added just some comments around testing.

Comment thread operator/scripts/olm-testing.sh
IFS=', ' read -r -a array <<< "$TARGET_NAMESPACES"
for element in "${array[@]}"
do
yq ea -i ".spec.targetNamespaces += [\"$element\"]" $OPERATOR_GROUP_FILE

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

spec.TargetNamespaces seems to be kinda deprecated? But maybe we don't even need it (specifying multiple namespaces here), see my comment above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would be in favor of separating that off as a another issue around supporting the selector - in general that will be a problem as the sdk nor our logic is honoring that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

olm does manage the watching of namespaces for the selector, and updates the operator deployment from there.

I see two issues with that (not related to keycloak):

  • the docuemtation is wrong, you cannot directly specify the label under the selector, it needs to be under a matchLabels stanza - if you try it as documented it does end up watching all namespaces. I'll open something for that.
  • if nothing matches the label olm won't update the deployment because it can't distinguish between watching nothing and watching everything. This seems like odd behavior as you'll end up still watching one or more namespaces that you don't intend to.

So on the script changes if you want I can either backout everything and we won't bother with those changes for now, or it could be updated to be based upon a label, or a label and target namespaces (such that the script adds the label to the targets).

@vmuzikar vmuzikar Sep 18, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for double checking!

So on the script changes if you want I can either backout everything and we won't bother with those changes for now, or it could be updated to be based upon a label, or a label and target namespaces (such that the script adds the label to the targets).

I'd keep only what's strictly necessary for testing these two scenarios in the CI:

  • Operator watching and being installed in a single namespace.
  • Operator watching all namespaces, i.e. empty watched namespaces.
  • And maybe one more scenario that we currently miss. That the Operator can watch a list of namespaces (MultiNamespace mode). I think we technically "support" this now. But we could add this test scenario later as a follow-up.

Which means we can keep everything in the scripts as we'd use targetNamespaces for the last scenario.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which means we can keep everything in the scripts as we'd use targetNamespaces for the last scenario.

If I understand you correctly you mean just leave it as is in the pr and don't try to switch to a label or namespace/label based mechanism.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't try to switch to a label or namespace/label based mechanism.

Yeah, I'd say it's OLM responsibility. No need to test it on our side.

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.

Descoped mode for the Operator

2 participants