-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add connection string secret annotations #119
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
feat: add connection string secret annotations #119
Conversation
@limwa thanks for the contribution and migrating the change to MCK repository. For the e2e tests to run MongoDB engineer needs to approve the CI pipeline. I did that and it seems PR needs to be updated with master and require running |
bc8f179
to
e87cef8
Compare
@MaciejKaras thanks! I've updated the branch with master and everything should be okay now. I've also changed the |
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.
From my side this is a complete feature with all necessary docs and testing. Great work!
412aec0
to
c918353
Compare
c918353
to
201ef1b
Compare
evergreen retry |
Any chance I could get the logs for the failing e2e_mco_tests job? |
@limwa It is fine, just flaky test |
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.
LGTM! Thanks for contributing it!
Thanks for your contribution @limwa. |
Thanks to everyone for approving this PR 🙏🏻 |
@limwa np :) feel free to merge the PR (squash and merge option please). |
I don't have write access to merge the PR haha, so I'll leave that to you! 😁 |
Summary
Fixes mongodb/mongodb-kubernetes-operator#1522.
This is a port of mongodb/mongodb-kubernetes-operator#1582.
In this PR, I've added the ability to add custom annotations to the generated connection string secrets in MongoDB Community Operator.
This is useful to handle more deployment scenarios, in particular, scenarios where the operator is not deployed cluster-wide, but to a specific namespace. In these scenarios, the
connectionStringSecretNamespace
property becomes useless because, as stated in the Kubernetes docs, cross-namespace owner references are disallowed, thus allowing for the secrets to be immediately garbage-collected, as stated in mongodb/mongodb-kubernetes-operator#1578. For the owner references to be valid, the secrets need to be generated in the namespace of the MDBC resource. However, if the user needs the secrets to be present in other namespaces, they can use reflector, for instance, which allows for the secrets to be copied to other namespaces. The problem is that reflector and other similar controllers require the source secrets to be annotated with specific properties.As such, I've implemented a
connectionStringSecretAnnotations
property that allows MongoDB Community Operator users to specify per-user connection string secret annotations.Proof of Work
I've added a unit test and an e2e test. The unit test is passing. Regarding the e2e test, it was passing in the mongodb-kubernetes-operator repository, but I couldn't figure out how to run the e2e tests in this repository.
Checklist
Reminder (Please remove this when merging)