diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a6d6ad2..8e6e793 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -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 diff --git a/src/main/resources/k8s-deployment.yaml b/src/main/resources/k8s-deployment.yaml new file mode 100644 index 0000000..1bfcc8d --- /dev/null +++ b/src/main/resources/k8s-deployment.yaml @@ -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 \ No newline at end of file