Skip to content

Commit

Permalink
UI runs fine on k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
sthaha committed Oct 13, 2019
1 parent 6999177 commit e47c51f
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 28 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/app.py → app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def hello():
vote = request.form['vote']
data = json.dumps({'voter_id': voter_id, 'vote': vote})
requests.post(url=rest_endpoint + "/vote", data=data)

resp = make_response(render_template(
'index.html',
option_a=option_a,
Expand Down Expand Up @@ -55,4 +55,4 @@ def send_js(path):


if __name__ == "__main__":
app.run(host='0.0.0.0', port=9090, debug=True)
app.run(host='0.0.0.0', port=8080, debug=True)
27 changes: 27 additions & 0 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ui
name: ui
spec:
replicas: 1
selector:
matchLabels:
app: ui
template:
metadata:
labels:
app: ui
spec:
containers:
- image: quay.io/sthaha/voting-ui:latest
name: ui
ports:
- containerPort: 8080
- containerPort: 9090
env:
- name: VOTING_API_SERVICE_HOST
value: api
- name: VOTING_API_SERVICE_PORT
value: "9000"
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: voting-ui
name: voting-ui
app: ui
name: ui
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
protocol: TCP
targetPort: 9090
selector:
app: voting-ui
app: ui
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions yaml-manifests/voting-ui-deployment-manifest.yaml

This file was deleted.

0 comments on commit e47c51f

Please sign in to comment.