From 5b3f5cd8920c402c22bb6f6d641932aca4031ea9 Mon Sep 17 00:00:00 2001 From: Karamjit Kaur Date: Thu, 11 Dec 2025 23:23:53 -0500 Subject: [PATCH 1/2] chores: quoteapp updated --- Dockerfile | 8 ++------ deployment.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ namespaces.yml | 4 ++++ pod.yml | 23 +++++++++++++++++++++++ service.yml | 18 ++++++++++++++++++ 5 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 deployment.yml create mode 100644 namespaces.yml create mode 100644 pod.yml create mode 100644 service.yml diff --git a/Dockerfile b/Dockerfile index 360b8d2..c31ccd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,6 @@ # Use the official OpenJDK 17 image as the base image -FROM openjdk:17-jdk-alpine - -# Set metadata -LABEL maintainer="trainwithshubham@gmail.com" -LABEL version="1.0" -LABEL description="A Java Quotes application" +# Dockerfile: Line 2 (Change this line) +FROM eclipse-temurin:21-jdk-alpine # Set the working directory inside the container WORKDIR /app diff --git a/deployment.yml b/deployment.yml new file mode 100644 index 0000000..0203329 --- /dev/null +++ b/deployment.yml @@ -0,0 +1,45 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: quotes-app + namespace: quoteapp + labels: + app: quotes + tier: backend +spec: + replicas: 2 + selector: + matchLabels: + app: quotes + tier: backend + template: + metadata: + labels: + app: quotes + tier: backend + spec: + containers: + - name: quotes-app + image: quotesapp:latest + imagePullPolicy: Never + ports: + - containerPort: 8000 + resources: + requests: + memory: "256Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "500m" + livenessProbe: + httpGet: + path: / + port: 8000 + initialDelaySeconds: 30 + periodSeconds: 10 + readinessProbe: + httpGet: + path: / + port: 8000 + initialDelaySeconds: 5 + periodSeconds: 5 diff --git a/namespaces.yml b/namespaces.yml new file mode 100644 index 0000000..fe29ac4 --- /dev/null +++ b/namespaces.yml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: quoteapp diff --git a/pod.yml b/pod.yml new file mode 100644 index 0000000..2e84606 --- /dev/null +++ b/pod.yml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Pod +metadata: + name: quote-pod + namespace: quoteapp + labels: + app: quotes + tier: backend +spec: + containers: + - name: quotes-app + image: quotesapp:latest + imagePullPolicy: Never + ports: + - containerPort: 8000 + resources: + requests: + memory: "256Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "500m" + diff --git a/service.yml b/service.yml new file mode 100644 index 0000000..5e9b110 --- /dev/null +++ b/service.yml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: quotes-service + namespace: quoteapp + labels: + app: quotes + tier: backend +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: 8000 + protocol: TCP + name: http + selector: + app: quotes + tier: backend From 910c1c58c992cb8a1b2eec846a40de7453f57d0b Mon Sep 17 00:00:00 2001 From: Karamsandhu2516 <153093789+Karamsandhu2516@users.noreply.github.com> Date: Sun, 14 Dec 2025 20:47:27 -0500 Subject: [PATCH 2/2] Modify deployment.yml for quotes-app settings Updated deployment configuration for quotes-app. --- deployment.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/deployment.yml b/deployment.yml index 0203329..7e7e14d 100644 --- a/deployment.yml +++ b/deployment.yml @@ -5,7 +5,7 @@ metadata: namespace: quoteapp labels: app: quotes - tier: backend + spec: replicas: 2 selector: @@ -19,27 +19,28 @@ spec: tier: backend spec: containers: - - name: quotes-app + + - name: quotes-app image: quotesapp:latest - imagePullPolicy: Never ports: - containerPort: 8000 - resources: - requests: - memory: "256Mi" - cpu: "100m" - limits: - memory: "512Mi" - cpu: "500m" + + livenessProbe: httpGet: - path: / + path: /healthz port: 8000 - initialDelaySeconds: 30 - periodSeconds: 10 + initialDelaySeconds: 20 + periodSeconds: 5 + timeoutSeconds: 5 + failureThreshold: 3 + + readinessProbe: httpGet: - path: / + path: /ready port: 8000 initialDelaySeconds: 5 - periodSeconds: 5 + periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 1