-
Notifications
You must be signed in to change notification settings - Fork 5
EVEREST-458 Restart everest-operator pod during the provisioning #163
Conversation
…rs (#151) * EVEREST-203 Do not run registration for already registered k8s clusters * EVEREST-203 Generated files * EVEREST-203 Added integration test * EVEREST-203 Fixed test * EVEREST-203 fixed test * EVEREST-203 Better deletion handling * EVEREST-203 Shut up linter * Update pkg/install/operators.go Co-authored-by: Michal Kralik <[email protected]> --------- Co-authored-by: Michal Kralik <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #163 +/- ##
========================================
- Coverage 5.10% 4.93% -0.18%
========================================
Files 12 12
Lines 2802 2899 +97
========================================
Hits 143 143
- Misses 2635 2732 +97
Partials 24 24
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this approach tries to restart the everest operator when we provision the cluster.
I'm wondering if cli is a good place for this logic.
There are other ways to install the upstream operators in which case we run into the same issue with the everest operator not being aware of the new upstream operators.
Have you considered placing the logic in the everest operator instead?
Can you elaborate on what the advantages/drawbacks are?
We have a ticket to halt the installation process if there are any operators present in the cluster that were installed without using everest.
Can you elaborate on what you mean by advantages/drawbacks? For what exactly? |
Having this on the operator side is not possible right now because we watch for the custom resources and we set watchers during the boot of the operator and the operator checks that CRD is available in the cluster and then adds it to the client. The result will be a failure to start for the operator if it's trying to watch for custom resources without this test. The operator can have a different client in that case with already configured custom schemes but this can be setup only during the run because the client needs to fill caches and everything else. |
I think it would be better to figure out how to implement this logic in the everest operator. From the design perspective this is the proper place. Implementation in cli seems like patching an issue without resolving the root cause and since this is not a pressing issue, I don't think we need to solve it with a quick fix. Can we figure out a way for the operator to know when an upstream operator has been added? Such as watching for CRDs or some OLM resources? |
You can open a Jira ticket for that to handle it in future releases. Right now, the issue is fixed for the end users with those changes. I think that there might be other solutions to that and the effort might be huge with the same benefit for the end user. |
@michal-kralik |
@michal-kralik another thing that might help is once kubernetes-sigs/controller-runtime#2456 will be implemented in the controller-runtime |
Can we also please revisit the tests? |
@michal-kralik I revisited them and they look good. Names are not the same |
Right, but why didn't they fail before? Are we missing any test? |
No idea but it worked for me and I ensured that names are different for the pods. The test is fine For the CLI actually operator tests were not failing but they should be and this changed last week afaik. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this but the integration tests don't provide much value if they don't fail if the logic is wrong 🙂
CHANGE DESCRIPTION
Problem:
EVEREST-458
EVEREST-458
Short explanation of the problem.
Everest operator adds all CRDs only once during the boot. When the user installed one database engine operator and installed another one by restarting the provisioning process the everest-operator doesn't know about added CRDs.
Solution:
Short explanation of the solution we are providing with this PR.
Restarting the everest-operator as the last step of provisioning operators solves this issue.
Also, since integration tests were failing I fixed EVEREST-458 as part of this
CHECKLIST
Jira
Tests