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

At what point does oc env MONGODB_SERVICE_HOST get populated? #6

Open
alberttwong opened this issue Oct 16, 2015 · 1 comment
Open

Comments

@alberttwong
Copy link
Contributor

I have a question. The code knows to pull the correct IP for mongodb using $MONGODB_SERVICE_HOST. When does this variable get created and populated? When "oc new-app mongodb" get executed? If so, I tried to do a search across this project (returned 0 results) and couldn't find the spot that defines it.

@thoraxe
Copy link
Contributor

thoraxe commented Dec 16, 2015

This is related to the fact that this app is somewhat designed for use with OpenShift.

MONGODB_SERVICE_HOST is an environment variable injected by Kubernetes/OpenShift as part of the Kubernetes service subsystem.

Until a service called "mongodb" exists in the project, this variable will have no value. Once a service called "mongodb" exists in the project, any time a pod is spun up it will have this value injected. Note that there is a limitation in Docker in that environment variables cannot be injected into a running process, which is why an existing instance of this app would not suddenly know about MONGODB_SERVICE_HOST until the pod was restarted.

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