Skip to content
Open

Test #50

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 92 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
# Compiled class file
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/

# Compiled class files
*.class

# Log file
# Log files
*.log

# BlueJ files
Expand All @@ -13,12 +35,74 @@
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
# Virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

# Spring Boot specific files
bin/

# Maven
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties

# Gradle
.gradle/

# Gradle Wrapper
!gradle/wrapper/gradle-wrapper.jar
!gradle/wrapper/gradle-wrapper.properties

# Eclipse
.caching/
.settings/

# OS-specific files
.DS_Store
Thumbs.db

# Other IDEs and tools
*.launch
*.swp
*~

# Exclude resources folder
src/main/resources/application-dev.properties

# Node
node_modules/
npm-debug.log

# MacOS
.AppleDouble
.LSOverride

# Windows
ehthumbs.db

# Linux

# Dependency directory
lib/

# Generated files
dist/
tmp/


### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Use an official OpenJDK runtime as a parent image
FROM openjdk:17-jdk-slim

# Set the working directory in the container
WORKDIR /app

# Copy the packaged jar file into the container
COPY target/*.jar app.jar

# Run the jar file
ENTRYPOINT ["java", "-jar", "app.jar"]
1 change: 0 additions & 1 deletion README.md

This file was deleted.

12 changes: 12 additions & 0 deletions Service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: saayam-demo-svc
namespace: kube-system
spec:
selector:
app: saayam-demo
ports:
- protocol: TCP
port: 80

70 changes: 70 additions & 0 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: saayam-demo-dp
labels:
app: saayam-demo
namespace: kube-system
spec:
replicas: 2
selector:
matchLabels:
app: saayam-demo
template:
metadata:
labels:
app: saayam-demo
spec:
containers:
- name: <your-container-name>
image: <your-ecr-repo-url>:latest
imagePullPolicy: Always
ports:
- containerPort: 80
env:
- name: SPRING_DATASOURCE_URL
value: "jdbc:postgresql://<your-database-url>:5432/<your-database-name>"
- name: SPRING_DATASOURCE_USERNAME
value: "<your-database-username>"
- name: SPRING_DATASOURCE_PASSWORD
value: "<your-database-password>"
- name: SPRING_PROFILES_ACTIVE
value: "dev"
name: request
spec:
replicas: 1
selector:
matchLabels:
app: request
template:
metadata:
labels:
app: request
spec:
containers:
- name: request
image: request:latest
imagePullPolicy: Never
ports:
- containerPort: 8080
env:
- name: SPRING_DATASOURCE_URL
value: "jdbc:postgresql://localhost:5432/your_database_name"
- name: SPRING_DATASOURCE_USERNAME
value: "your_username"
- name: SPRING_DATASOURCE_PASSWORD
value: "your_password"
- name: SPRING_PROFILES_ACTIVE
value: "dev"
---
apiVersion: v1
kind: Service
metadata:
name: request
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
selector:
app: request
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
request:
build:
context: .
dockerfile: Dockerfile
container_name: request
ports:
- "8080:8080"
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/saayam
- SPRING_DATASOURCE_USERNAME=lydialu
- SPRING_DATASOURCE_PASSWORD=qweasd
- SPRING_PROFILES_ACTIVE=dev
22 changes: 22 additions & 0 deletions ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: saayam-demo-ingress
namespace: kube-system
annotations:
alb.ingress.kubernetes.io/load-balancer-name: <your-load-balancer-name>
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/subnets: <your-subnet-id-1>,<your-subnet-id-2>,<your-subnet-id-3>
spec:
ingressClassName: alb
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: saayam-demo-svc
port:
number: 80
Loading
Loading