From 5a4f37079f68b63bcbaccc60b7f4ea1403df511f Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Wed, 10 Dec 2025 15:32:48 +0530 Subject: [PATCH 01/13] Create Dockerfile --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bcfe26d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.14.2-alpine3.22 +LABEL version="1.0" +MAINTAINER SanthoshNC +ENV MY_APP="hello-world-python" +RUN mkdir /app +WORKDIR /app +COPY . /app +EXPOSE 8080 +CMD ["python3", "app.py"] From 1d7fc5bdf6a83eea616e07c75783b9ea6647cf5e Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Thu, 11 Dec 2025 10:01:03 +0530 Subject: [PATCH 02/13] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index d3725f0..60f4e61 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,7 @@ def do_GET(self): \____\_______/ -Hello from Docker! +Hello from Docker This is Nithish Kumar R N! ''') def run(): From bfc8ef2e4175397248d6f1c8a32afc5f9b55bb12 Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Thu, 11 Dec 2025 10:16:29 +0530 Subject: [PATCH 03/13] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bcfe26d..6d9c843 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.14.2-alpine3.22 LABEL version="1.0" MAINTAINER SanthoshNC -ENV MY_APP="hello-world-python" +ENV MY_APP="hello-world-python from Nithish Kumar R N" RUN mkdir /app WORKDIR /app COPY . /app From 5f886cb66357a3bb51791064712a554015faa92a Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Thu, 11 Dec 2025 10:56:46 +0530 Subject: [PATCH 04/13] Create docker-ci.yaml --- .github/workflows/docker-ci.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-ci.yaml diff --git a/.github/workflows/docker-ci.yaml b/.github/workflows/docker-ci.yaml new file mode 100644 index 0000000..c871d4a --- /dev/null +++ b/.github/workflows/docker-ci.yaml @@ -0,0 +1,18 @@ +name: Docker CI Pipeline +run-name: ${{ github.actor }} is running out Docker CI Pipeline 🚀 +on: [push] +jobs: + hello-world-job: + runs-on: ubuntu-latest + steps: + - name: Clone the code + uses: actions/checkout@v6 + - name: Build the image + run: docker build -t ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:v1 . + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Push the image + run: docker push ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:v1 From c94eb9a89a5e946de52625c04b960eaa2a71b0a4 Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:09:52 +0530 Subject: [PATCH 05/13] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 60f4e61..d9920dd 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,7 @@ def do_GET(self): \____\_______/ -Hello from Docker This is Nithish Kumar R N! +Hello from Docker This is Nithish Kumar R N !! ''') def run(): From b48c3ce32270de3f348622c4acd4bca7ff56822b Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:45:46 +0530 Subject: [PATCH 06/13] Update docker-ci.yaml --- .github/workflows/docker-ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-ci.yaml b/.github/workflows/docker-ci.yaml index c871d4a..4521c10 100644 --- a/.github/workflows/docker-ci.yaml +++ b/.github/workflows/docker-ci.yaml @@ -16,3 +16,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push the image run: docker push ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:v1 + - name: Run the container + run: docker run --name helloworld-demo-python -itd -p 8080:8080 ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:v1 + - name: View the container + run: docker ps From d7f63651ce0fa1720c07b68e1c38b81258a4a08e Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:46:45 +0530 Subject: [PATCH 07/13] Update docker-ci.yaml --- .github/workflows/docker-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-ci.yaml b/.github/workflows/docker-ci.yaml index 4521c10..5037851 100644 --- a/.github/workflows/docker-ci.yaml +++ b/.github/workflows/docker-ci.yaml @@ -16,7 +16,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push the image run: docker push ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:v1 - - name: Run the container + - name: Run the container run: docker run --name helloworld-demo-python -itd -p 8080:8080 ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:v1 - name: View the container run: docker ps From 474f7d7e9c1ade16f5128263b0cefa47355d8ca5 Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Fri, 12 Dec 2025 10:26:33 +0530 Subject: [PATCH 08/13] Create deployment.yaml --- Deployment/deployment.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Deployment/deployment.yaml diff --git a/Deployment/deployment.yaml b/Deployment/deployment.yaml new file mode 100644 index 0000000..414abaa --- /dev/null +++ b/Deployment/deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world-deployment + labels: + app: hello-world-python +spec: + replicas: 7 + selector: + matchLabels: + app: hello-world-python + template: + metadata: + labels: + app: hello-world-python + spec: + containers: + - name: hello-world-python + image: nithishkumarrn/helloworld-demo-python:v1 + ports: + - containerPort: 8080 From 7b3dd3b35feae20845913219b49dcd7c692432d4 Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Fri, 12 Dec 2025 10:44:45 +0530 Subject: [PATCH 09/13] Create service.yaml --- .../service.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/service.yaml diff --git a/Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/service.yaml b/Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/service.yaml new file mode 100644 index 0000000..3358c4f --- /dev/null +++ b/Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: my-service +spec: + selector: + app.kubernetes.io/hello-world-python: MyApp + ports: + - protocol: TCP + port: 8080 + targetPort: 8080 From 317646e1b7f3f371d920d9aa00cf60c23851e9c7 Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Fri, 12 Dec 2025 10:46:16 +0530 Subject: [PATCH 10/13] Create service.yaml --- Deployment/service.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Deployment/service.yaml diff --git a/Deployment/service.yaml b/Deployment/service.yaml new file mode 100644 index 0000000..3358c4f --- /dev/null +++ b/Deployment/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: my-service +spec: + selector: + app.kubernetes.io/hello-world-python: MyApp + ports: + - protocol: TCP + port: 8080 + targetPort: 8080 From ca37685ae14a09c25dfe7be5e86c4e325b37d58c Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Fri, 12 Dec 2025 10:46:59 +0530 Subject: [PATCH 11/13] Delete Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io directory --- .../service.yaml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/service.yaml diff --git a/Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/service.yaml b/Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/service.yaml deleted file mode 100644 index 3358c4f..0000000 --- a/Deployment/apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: my-service -spec: - selector: - app.kubernetes.io/hello-world-python: MyApp - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 From c1a81bb3adc63d9937115aac563ed93948ebbeb3 Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Fri, 12 Dec 2025 11:15:04 +0530 Subject: [PATCH 12/13] Create k8s-implementation.yaml --- Deployment/k8s-implementation.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Deployment/k8s-implementation.yaml diff --git a/Deployment/k8s-implementation.yaml b/Deployment/k8s-implementation.yaml new file mode 100644 index 0000000..f1a5a81 --- /dev/null +++ b/Deployment/k8s-implementation.yaml @@ -0,0 +1,21 @@ + k8s-implementation: + needs: docker-build-push + runs-on: ubuntu-latest + steps: + - name: Clone the code + uses: actions/checkout@v6 + + - name: Start minikube + uses: medyagh/setup-minikube@latest + - name: Try the cluster! + run: kubectl get pods -A + + - name: Create Deployment and Service + run: | + kubectl apply -f k8s/deployment.yaml + kubectl apply -f k8s/service.yaml + kubectl wait --for=condition=ready pod -l app=hello-world-python + - name: View Deployment and Service + run: | + kubectl get deployments + kubectl get service From f93766ed1b7ec742ee42f4d40b002caefd34b643 Mon Sep 17 00:00:00 2001 From: Nithish Kumar R N <57987179+nithishkumar3@users.noreply.github.com> Date: Fri, 12 Dec 2025 17:08:29 +0530 Subject: [PATCH 13/13] Create main.tf --- Terraform/main.tf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Terraform/main.tf diff --git a/Terraform/main.tf b/Terraform/main.tf new file mode 100644 index 0000000..f315e42 --- /dev/null +++ b/Terraform/main.tf @@ -0,0 +1,23 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.92" + } + } + + required_version = ">= 1.2" +} + +provider "aws" { + region = "us-east-1" +} + +resource "aws_instance" "app_server" { + ami = "ami-0ecb62995f68bb549" + instance_type = "t2.micro" + + tags = { + Name = "learn-terraform" + } +}