commit 227a14ef0a1e6774c7dee6af52aa79a06adbc813 Author: luka Date: Wed Nov 9 16:29:45 2022 +0100 First commit diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3fcb823 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +__pycache__/ +venv/ +docker-secret/ \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fcb823 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ +venv/ +docker-secret/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..013d080 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/app.py b/app.py new file mode 100644 index 0000000..3e2a332 --- /dev/null +++ b/app.py @@ -0,0 +1,8 @@ +from flask import Flask + +app = Flask(__name__) + +@app.route('/') +def index(): + return "Hello world!!" + diff --git a/k8s/test-deployment.yaml b/k8s/test-deployment.yaml new file mode 100644 index 0000000..c47d7b7 --- /dev/null +++ b/k8s/test-deployment.yaml @@ -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 diff --git a/k8s/test-service.yaml b/k8s/test-service.yaml new file mode 100644 index 0000000..830c1cc --- /dev/null +++ b/k8s/test-service.yaml @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b708e37 --- /dev/null +++ b/requirements.txt @@ -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