-
Notifications
You must be signed in to change notification settings - Fork 4
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
Unable to run the application in docker and K8s #1
Comments
hello @sahil-sharma. For the Docker use-case, you will probably need to set an env variable to the For your k8s use case, I cannot see any error in your screenshot, am I missing something? The last event for the postgres pod is: |
@sahil-sharma can you try with the templates from 3d47f6e ? The |
ok, I think you're missing the other env vars defined in the template: see your |
You mean to say I have to provide all the details of Postgres the app container as it is: |
yes, in the Docker command to start the webapp, you need to specify those env vars. This is what the deployment config does in https://github.com/xcoulon/go-url-shortener/blob/master/templates/database-deployment.yml#L17-L36 |
hello @xcoulon, I tried to run the application using the specific templates from the commit you mentioned and it worked fine. But, I am unable to find any difference. Though the postgres pod is still showing Created container, Started container. But, the data persists. Thanks for the help! Now, I am exploring how to configure a static/dynamic volume creation using GlusterFS/Ceph/Rook sort of. Because, the approach you used is fine when you're not scaling your DB pods. The moment we have to scale the DB then we need something similar. Is my understanding correct on this? Let me try and if I will be able to achieve this then I will send you a PR. You can share any links which could help me to achieve this and I want to set-up monitoring and logging for this. Any inputs on this would be of great help. I can do the testing if you have something else I will try to monitor it. |
Hello,
I tried to run the application first in docker then in K8s but failed to bring the app in both the scenarios.
Docker use-case
OS: Ubuntu:16.04
Docker version: 17.12.1-ce
RAM: 4GB
Postgres container:
URL-Shortner app
URL-Shortner app is unable to connect to the Postgres DB as the DB is listening on localhost:5432. Despite I set the hostname of the DB container and link the DB container to the app container. Logically, it should connect to the DB over the hostname. But, the DB itslef is listening on the localhost:5432 hence connections from the outside won't be accepted. I checked the code and you've hardcoded it as "localhost".
Error:
Please advise how can I run the application in docker containers.
Kubernetes use-case
OS: Ubuntu:16.04
K8s cluster: 1.12 (Kubeadm single node)
I have all the YAML files.
I created secrets at first. Then I created the configmap.yaml.
Then created PV-PVC for PostgreSQL and it created successfully.
Then created postgres {deployment and service}. It has been created but the volumes didn't mount.
There is no change in the YAML files. Can you please look into this?
The text was updated successfully, but these errors were encountered: