Skip to content
Open
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
7 changes: 4 additions & 3 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
spring.application.name=spring-file-processing

# PostgreSQL configurations
spring.datasource.url=jdbc:postgresql://localhost:5432/database_name
spring.datasource.username=
spring.datasource.password=
spring.datasource.url=jdbc:postgresql://localhost:5432/customer_db
spring.datasource.username=postgres
spring.datasource.password=admin
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

# Spring batch configurations
spring.batch.initialize-schema=always
spring.batch.job.enabled=false
spring.batch.jdbc.initialize-schema=always
50 changes: 50 additions & 0 deletions src/main/resources/k8s-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: spring-file-processing-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: spring-file-processing
spec:
replicas: 1
selector:
matchLabels:
app: spring-file-processing
template:
metadata:
labels:
app: spring-file-processing
spec:
containers:
- name: spring-file-processing
image: localhost:5000/spring-file-processing:latest
ports:
- containerPort: 8080
env:
- name: SPRING_DATASOURCE_URL
value: "jdbc:postgresql://postgres:5432/customer_db"
- name: SPRING_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
name: spring-file-processing-secrets
key: DB_USERNAME
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
name: spring-file-processing-secrets
key: DB_PASSWORD
---
apiVersion: v1
kind: Service
metadata:
name: spring-file-processing
spec:
selector:
app: spring-file-processing
ports:
- port: 8080
targetPort: 8080
nodePort: 30080
type: NodePort