Hi Albert thank you for your quick answer, unfortunately those resources did not fix my issue…
My goal is to get the MongoDB Enterprise Kubernetes operator deployed as part of a touch-free CI/CD pipeline, so I need to be able to get it deployed without any human interaction in the process.
The first link you sent “Organization Programmatic API Keys” requires an API Key being already available “curl --user “{PUBLIC-KEY}:{PRIVATE-KEY}” --digest \ …” which I can not get unless I use the OpsManager UI.
The second resource sounds like what I need, but again it requires an existing user and the knowledge of the API key which again is only accessible via OpsManager UI.
When the Ops Manager resource is created it requires a ops-manager-admin-secret being in kubernetes and those credentials are used to create the default user with GLOBAL_OWNER role:
kubectl apply -f ops-manager.yaml
Once you have the default user created you are forced to generate a new user’s API Key for any operation you want to do via REST, so you need to use the OpsManager UI.
I thought about creating a new first user via REST call which does not require API key and then upgrade that user’s role to GLOBAL_OWNER but I can not do that unless I have the API Key of the default user, the one created from the secret… which again forces me to use the Ops Manager UI.
Another thing I tried was to create the Ops Manager resource via yaml in kubernetes without the ops-manager-admin-secret, and that worked partially as I could use the Ops Manager Rest API to create the first user with GLOBAL_OWNER role, but then I got the following error saying that Ops Manager can not be initialized properly without a secret:
Status:
Application Database:
Last Transition: 2021-03-04T16:24:34Z
Members: 3
Observed Generation: 1
Phase: Running
Version: 4.2.2
Ops Manager:
Last Transition: 2021-03-04T16:24:34Z
Message: The secret mongodb/ doesn't exist - you need to create it to finish Ops Manager initialization
Observed Generation: 1
Phase: Failed
URL: http://ops-manager-svc.mongodb.svc.cluster.local:8080
Events: <none>
I am blocked in this loop where for any action I do I have to end up login into the Ops Manager UI to generate a new API Key therefore not being able to automate the MongoDB Enterprise Kubernetes operator deployment.
Surely must be possible to deploy it automatically without any human interaction with the UI but I have not found any way so far. Any idea what sequence of API calls I could follow to get the Ops Manager initialized properly?