mirror of
https://github.com/slurm-personal/school-dev-k8s.git
synced 2026-06-27 13:50:24 +00:00
fix numeration
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
FROM python:3.6.8
|
||||
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN pip install -r /app/requirements.txt
|
||||
|
||||
COPY . /app
|
||||
|
||||
ENTRYPOINT python /app/app.py
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
from flask import Flask
|
||||
from flask import request
|
||||
|
||||
config = {
|
||||
"port": os.environ.get('PORT', 8000),
|
||||
"debug": os.environ.get('DEBUG', False)
|
||||
}
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hello, Updated!"
|
||||
|
||||
@app.route("/api/sum")
|
||||
def sum():
|
||||
a = request.args.get('a')
|
||||
b = request.args.get('b')
|
||||
return "{0}+{1}={2}".format(a, b, int(a)+int(b))
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=config["port"], debug=config["debug"])
|
||||
@@ -0,0 +1,31 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: myapp
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: myapp
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: myapp
|
||||
spec:
|
||||
containers:
|
||||
- name: api
|
||||
image: myapp:dev
|
||||
env:
|
||||
- name: PYTHONUNBUFFERD
|
||||
value: "1"
|
||||
- name: DEBUG
|
||||
value: "True"
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
volumeMounts:
|
||||
- name: code
|
||||
mountPath: /app
|
||||
volumes:
|
||||
- name: code
|
||||
hostPath:
|
||||
path: /app
|
||||
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: myapp
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: myapp
|
||||
ports:
|
||||
- port: 8000
|
||||
targetPort: 8000
|
||||
@@ -0,0 +1,5 @@
|
||||
Flask==1.1.2
|
||||
itsdangerous==1.1.0
|
||||
Jinja2==2.11.2
|
||||
MarkupSafe==1.1.1
|
||||
Werkzeug==1.0.1
|
||||
Reference in New Issue
Block a user