Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
run: |
kubectl apply -f k8s/db_secret.yaml
kubectl apply -f k8s/db_deployment.yaml
kubectl apply -f k8s/db_config.yaml
kubectl apply -f k8s/db_config_security.yaml
kubectl apply -f k8s/db_service.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
Expand Down
7 changes: 0 additions & 7 deletions k8s/db_config.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions k8s/db_config_security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: db-config-security
data:
SPRING_DATASOURCE_URL: jdbc:postgresql://micropay-db:5432/security_db
6 changes: 3 additions & 3 deletions k8s/db_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ spec:
env:
- name: POSTGRES_USER
valueFrom:
configMapKeyRef:
name: db-config
key: SPRING_DATASOURCE_USERNAME
secretKeyRef:
name: db-secret
key: SPRING_DATASOURCE_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
Expand Down
1 change: 1 addition & 0 deletions k8s/db_secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ metadata:
type: Opaque
data:
SPRING_DATASOURCE_PASSWORD: cGFzc3dvcmQ=
SPRING_DATASOURCE_USER: dXNlcg==
7 changes: 6 additions & 1 deletion k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
- containerPort: 8150
envFrom:
- configMapRef:
name: db-config
name: db-config-security
env:
- name: SECURITY_JWT_SECRET
valueFrom:
Expand All @@ -32,6 +32,11 @@ spec:
secretKeyRef:
name: db-secret
key: SPRING_DATASOURCE_PASSWORD
- name: DATASOURCE_USER
valueFrom:
secretKeyRef:
name: db-secret
key: SPRING_DATASOURCE_USER
readinessProbe:
httpGet:
path: /actuator/health
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ spring:
name: micropay-security

datasource:
url: ${SPRING_DATASOURCE_URL}/security_db
username: ${SPRING_DATASOURCE_USERNAME}
url: ${SPRING_DATASOURCE_URL}
username: ${DATASOURCE_USER}
password: ${DATASOURCE_PASSWORD}
driver-class-name: org.postgresql.Driver

Expand Down