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

Two Jankiram/web GitHub projects #1

Open
rasekar2000 opened this issue Jun 7, 2017 · 0 comments
Open

Two Jankiram/web GitHub projects #1

rasekar2000 opened this issue Jun 7, 2017 · 0 comments

Comments

@rasekar2000
Copy link

rasekar2000 commented Jun 7, 2017

Current janakiram/web in DockerHub (https://hub.docker.com/r/janakiramm/web/)
actually, refers to the following Python based following Docker file @PORT 500
https://github.com/janakiramm/kubernetes-101/blob/master/Docker/build.sh.

But in the Replication Controller, Webapp refers to the NodeJS + MongoDB based App running @3000 port
https://github.com/janakiramm/do-k8s/blob/master/todo-all-in-one.yaml#L75
I am not sure about github location for this nodejs+mongodb source code.

And hence I changed this Python code to use Kube Service ENV variable with redis:alpine docker hub image.

from flask import Flask
from redis import Redis
import os
app = Flask(__name__)
redis = Redis(host=os.environ.get('DB_SERVICE_HOST', 'redis'), port=os.environ.get('DB_SERVICE_PORT', 'port'))

@app.route('/')
def hello():
    redis.incr('hits')
    return 'Hello Container World! I have been seen %s times.\n' % redis.get('hits')

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5000, debug=True)

And everything worked. So, you may review this when you have some time to fix whichever janankiram/web accordingly.

Thanks in advance.

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

1 participant