First commit

master
Luka 2022-11-09 16:29:45 +01:00
commit 227a14ef0a
7 changed files with 71 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
__pycache__/
venv/
docker-secret/

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
__pycache__/
venv/
docker-secret/

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
CMD ["python3", "-m", "flask", "run", "--host=0.0.0.0"]

8
app.py Normal file
View File

@ -0,0 +1,8 @@
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "Hello world!!"

25
k8s/test-deployment.yaml Normal file
View File

@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: luka-app
name: luka-app
namespace: jsikubernetes
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: luka-app
template:
metadata:
labels:
app.kubernetes.io/name: luka-app
spec:
containers:
- name: luka-app
image: lukaboljevic/testapp:jsi
imagePullPolicy: Always
ports:
- containerPort: 5000
imagePullSecrets:
- name: luka-test-app-creds

13
k8s/test-service.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: luka-service
namespace: jsikubernetes
spec:
type: LoadBalancer
selector:
app.kubernetes.io/name: luka-app
ports:
- port: 4567
targetPort: 5000
protocol: TCP

8
requirements.txt Normal file
View File

@ -0,0 +1,8 @@
click==8.1.3
Flask==2.2.2
importlib-metadata==5.0.0
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
Werkzeug==2.2.2
zipp==3.10.0