From 6c76181b32bcfd6d52116f1363d57b573df10036 Mon Sep 17 00:00:00 2001 From: subodhgujar Date: Sun, 4 Dec 2022 18:05:13 -0500 Subject: [PATCH 1/4] added docker file to create image --- Deployment/Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Deployment/Dockerfile diff --git a/Deployment/Dockerfile b/Deployment/Dockerfile new file mode 100644 index 0000000..d7b56fb --- /dev/null +++ b/Deployment/Dockerfile @@ -0,0 +1,14 @@ +# syntax=docker/dockerfile:1 + +FROM python:3.8-slim-buster + +WORKDIR /job-analyzer + +COPY requirements.txt requirements.txt +RUN pip3 install -r requirements.txt + +COPY . . + +CMD [ "python3", "-m" , "flask","--app=src.app", "run", "--host=0.0.0.0"] + +#docker run -d -p 5000:5000 job-analyzer \ No newline at end of file From 94cd5d993b969d82db36b84ce65afac072c30ce4 Mon Sep 17 00:00:00 2001 From: subodhgujar Date: Sun, 4 Dec 2022 18:05:41 -0500 Subject: [PATCH 2/4] added deployment.yml --- Deployment/deployment.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Deployment/deployment.yml diff --git a/Deployment/deployment.yml b/Deployment/deployment.yml new file mode 100644 index 0000000..c3436f8 --- /dev/null +++ b/Deployment/deployment.yml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: job-analyzer-deployment +spec: + selector: + matchLabels: + app: job-analyzer + replicas: 3 + template: + metadata: + labels: + app: job-analyzer + spec: + containers: + - name: job-analyzer + image: job-analyzer + ports: + - containerPort: 5000 \ No newline at end of file From a407f0632ad3ba9484a70a244cf1559c1b94427c Mon Sep 17 00:00:00 2001 From: subodhgujar Date: Sun, 4 Dec 2022 18:05:49 -0500 Subject: [PATCH 3/4] added service.yml --- Deployment/service.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Deployment/service.yml diff --git a/Deployment/service.yml b/Deployment/service.yml new file mode 100644 index 0000000..e3df169 --- /dev/null +++ b/Deployment/service.yml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: job-analyzer-service +spec: + ports: + - port: 5000 + targetPort: 8080 + name: http + selector: + app: job-analyzer \ No newline at end of file From cb2d8c4cd06acb83d8a3e288b1f1d4db853a9def Mon Sep 17 00:00:00 2001 From: subodhgujar Date: Sun, 4 Dec 2022 18:06:10 -0500 Subject: [PATCH 4/4] exposing application on cloud using ingress route --- Deployment/route.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Deployment/route.yml diff --git a/Deployment/route.yml b/Deployment/route.yml new file mode 100644 index 0000000..99c5a12 --- /dev/null +++ b/Deployment/route.yml @@ -0,0 +1,15 @@ +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: job-analyzer-ingress + annotations: + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/backend-protocol: "HTTP" +spec: + rules: + - host: job-analyzer.se22.com/ + http: + paths: + backend: + serviceName: job-analyzer-service + servicePort: http \ No newline at end of file