From 020cc5a27f22e67b584ce084d91ec11de892ee82 Mon Sep 17 00:00:00 2001 From: Joshua Stein Date: Wed, 25 Jan 2023 12:24:26 -0500 Subject: [PATCH 1/2] fix base image --- polling-app-server/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/polling-app-server/Dockerfile b/polling-app-server/Dockerfile index d6e6af65..1b9707ac 100644 --- a/polling-app-server/Dockerfile +++ b/polling-app-server/Dockerfile @@ -1,5 +1,5 @@ #### Stage 1: Build the application -FROM openjdk:8-jdk-alpine as build +FROM amazoncorretto:11 as build # Set the current working directory inside the image WORKDIR /app @@ -20,11 +20,11 @@ RUN ./mvnw dependency:go-offline -B COPY src src # Package the application -RUN ./mvnw package -DskipTests +RUN ./mvnw package -DskipTests -e RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar) #### Stage 2: A minimal docker image with command to run the app -FROM openjdk:8-jre-alpine +FROM amazoncorretto:11 ARG DEPENDENCY=/app/target/dependency @@ -33,4 +33,4 @@ COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app -ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.polls.PollsApplication"] \ No newline at end of file +ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.polls.PollsApplication"] From 4d2b6e4408449ad2f255a17049d74f7f4a35d8cb Mon Sep 17 00:00:00 2001 From: Joshua Stein Date: Wed, 25 Jan 2023 14:58:05 -0500 Subject: [PATCH 2/2] ingress --- deployments/polling-app-client.yaml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/deployments/polling-app-client.yaml b/deployments/polling-app-client.yaml index 3894097d..a1fb0ec1 100644 --- a/deployments/polling-app-client.yaml +++ b/deployments/polling-app-client.yaml @@ -35,4 +35,27 @@ spec: ports: # Forward incoming connections on port 80 to the target port 80 in the Pod - name: http port: 80 - targetPort: 80 \ No newline at end of file + targetPort: 80 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: polling-app-client + namespace: polling-app + annotations: + alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:899456967600:certificate/e355d30c-7dcf-4965-8f23-ca3f6b491641 + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/target-type: ip +spec: + ingressClassName: alb + rules: + - host: yourdomain.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: polling-app-client + port: + number: 80