Update config to use env variables
This commit is contained in:
@@ -24,16 +24,26 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
env:
|
env:
|
||||||
- name: SPRING_DATASOURCE_URL
|
- name: SPRING_DATASOURCE_HOST
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: todo-config
|
name: todo-config
|
||||||
key: DATABASE_URL
|
key: SPRING_DATASOURCE_HOST
|
||||||
|
- name: SPRING_DATASOURCE_PORT
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: todo-config
|
||||||
|
key: SPRING_DATASOURCE_PORT
|
||||||
|
- name: SPRING_DATASOURCE_DB
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: todo-config
|
||||||
|
key: SPRING_DATASOURCE_DB
|
||||||
- name: SPRING_DATASOURCE_USERNAME
|
- name: SPRING_DATASOURCE_USERNAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: todo-config
|
name: todo-config
|
||||||
key: DATABASE_USERNAME
|
key: SPRING_DATASOURCE_USERNAME
|
||||||
- name: SPRING_DATASOURCE_PASSWORD
|
- name: SPRING_DATASOURCE_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
@@ -43,12 +53,17 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: todo-config
|
name: todo-config
|
||||||
key: REDIS_HOST
|
key: SPRING_REDIS_HOST
|
||||||
- name: SPRING_REDIS_PORT
|
- name: SPRING_REDIS_PORT
|
||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: todo-config
|
name: todo-config
|
||||||
key: REDIS_PORT
|
key: SPRING_REDIS_PORT
|
||||||
|
- name: SPRING_REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: todo-db-secret
|
||||||
|
key: REDIS_PASSWORD
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "512Mi"
|
memory: "512Mi"
|
||||||
@@ -99,7 +114,7 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: todo-config
|
name: todo-config
|
||||||
key: DATABASE_USERNAME
|
key: SPRING_DATASOURCE_USERNAME
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ metadata:
|
|||||||
name: todo-config
|
name: todo-config
|
||||||
namespace: todo-test
|
namespace: todo-test
|
||||||
data:
|
data:
|
||||||
DATABASE_URL: "jdbc:postgresql://todo-postgres:5432/building_materials"
|
SPRING_DATASOURCE_HOST: "todo-postgres"
|
||||||
DATABASE_USERNAME: "postgres"
|
SPRING_DATASOURCE_PORT: "5432"
|
||||||
REDIS_HOST: "todo-redis"
|
SPRING_DATASOURCE_DB: "building_materials"
|
||||||
REDIS_PORT: "6379"
|
SPRING_DATASOURCE_USERNAME: "postgres"
|
||||||
|
SPRING_REDIS_HOST: "todo-redis"
|
||||||
|
SPRING_REDIS_PORT: "6379"
|
||||||
API_BASE_URL: "http://todo-backend:8080"
|
API_BASE_URL: "http://todo-backend:8080"
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@@ -16,8 +18,10 @@ metadata:
|
|||||||
name: todo-config
|
name: todo-config
|
||||||
namespace: todo-prod
|
namespace: todo-prod
|
||||||
data:
|
data:
|
||||||
DATABASE_URL: "jdbc:postgresql://todo-postgres:5432/building_materials"
|
SPRING_DATASOURCE_HOST: "todo-postgres"
|
||||||
DATABASE_USERNAME: "postgres"
|
SPRING_DATASOURCE_PORT: "5432"
|
||||||
REDIS_HOST: "todo-redis"
|
SPRING_DATASOURCE_DB: "building_materials"
|
||||||
REDIS_PORT: "6379"
|
SPRING_DATASOURCE_USERNAME: "postgres"
|
||||||
|
SPRING_REDIS_HOST: "todo-redis"
|
||||||
|
SPRING_REDIS_PORT: "6379"
|
||||||
API_BASE_URL: "http://todo-backend:8080"
|
API_BASE_URL: "http://todo-backend:8080"
|
||||||
|
|||||||
Reference in New Issue
Block a user