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

Import resources from MongoDBcloud #27

Open
eladazary opened this issue Dec 29, 2019 · 5 comments
Open

Import resources from MongoDBcloud #27

eladazary opened this issue Dec 29, 2019 · 5 comments

Comments

@eladazary
Copy link

Hi,

I would like to use your tool only for user creation. In order to do that I need to create a project.
Can you please add support in importing resources as project/clusters so that I wouldn't need to create a new project?

Thanks,
Elad

@Knappek
Copy link
Owner

Knappek commented Dec 29, 2019

Hi @eladazary, thank you for this feature request, this is a good idea. We should think about this import functionality for all resources, i.e. projects, clusters, database-users and alert configurations. Meaning, if someone started with Atlas manually, they can easily import everything to be managed via the operator.

This feature could be more tricky than expected: How do we implement this? we have multiple options:

  1. you create a resource on the K8s cluster (e.g. a a project like this). A problem is when the spec differs from the already existing setup. The operator will override the existing setup with the one provided in the spec. Is this fine?
  2. create a resource with an empty spec which tells the operator that the resource already exists and let the operator fill in the spec with all configurations. Question is: is it cool to have the operator modify the spec? It should only touch the status, but not the spec, the spec is for users to modify/tell the operator about changes.

What's you opinion on that?

@eladazary
Copy link
Author

eladazary commented Dec 30, 2019 via email

@Knappek
Copy link
Owner

Knappek commented Dec 30, 2019

I will think about how to implement it...if you want to go ahead and start implementing, feel free to do it. We could split this feature in several PRs for all separate resources and start with the simplest one, a project.

@eladazary
Copy link
Author

I will try to find some time to work on it.
Do you know if there is a way to create the DB users without creating a cluster via the operator?
I would like to create a user but it keeps telling me that "MongoDBAtlasProject.knappek.com "" not found"

@Knappek
Copy link
Owner

Knappek commented Dec 31, 2019

You mean "..without creating a project via the operator...", right?
Unfortunately, this is not possible, as it is trying to get the project information from the MongoDBAtlasProject CRD: https://github.com/Knappek/mongodbatlas-operator/blob/master/pkg/controller/mongodbatlasdatabaseuser/mongodbatlasdatabaseuser_controller.go#L101-L110

I think we should definitely add the import functionality to be able to start managing existing resources with the operator.
In theory, this functionality should be available already for projects as you can see in these lines where the status will be filled if the operator finds an existing porject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants