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: 2 additions & 0 deletions src/deployer/helm/infra/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,6 @@ postgresql:
# tables inside this database on first startup (schema-update=true).
02-create-workflow-db.sql: |
CREATE DATABASE mifos_flowable;
03-create-messagegateway-db.sql: |
CREATE DATABASE messagegateway;

81 changes: 81 additions & 0 deletions src/deployer/manifests/mifosx/message-gateway-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: message-gateway
tier: backend
name: message-gateway
spec:
replicas: 1
selector:
matchLabels:
app: message-gateway
strategy:
type: Recreate
template:
metadata:
labels:
app: message-gateway
tier: backend
spec:
initContainers:
- name: ensure-messagegateway-db
image: postgres:16-alpine
env:
- name: PGPASSWORD
value: "postgrespw"
command:
- /bin/sh
- -c
- |
set -e
until pg_isready -h postgres.infra.svc.cluster.local -p 5432 -U postgres; do
echo "waiting for postgres..."; sleep 3
done
if psql -h postgres.infra.svc.cluster.local -U postgres -tAc \
"SELECT 1 FROM pg_database WHERE datname='messagegateway'" | grep -q 1; then
echo "messagegateway DB already exists"
else
echo "creating messagegateway DB"
createdb -h postgres.infra.svc.cluster.local -U postgres messagegateway
fi
containers:
- name: message-gateway
image: openmf/message-gateway:dev-51abedb
imagePullPolicy: IfNotPresent
env:
- name: DB_URL
value: "jdbc:postgresql://postgres.infra.svc.cluster.local:5432/messagegateway"
- name: DB_USERNAME
value: "postgres"
- name: DB_PASSWORD
value: "postgrespw"
- name: DB_DRIVER
value: "org.postgresql.Driver"
ports:
- containerPort: 9191
protocol: TCP
- containerPort: 5009
protocol: TCP
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 9191
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 6
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 9191
initialDelaySeconds: 60
periodSeconds: 20
failureThreshold: 3
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "1000m"
restartPolicy: Always
21 changes: 21 additions & 0 deletions src/deployer/manifests/mifosx/message-gateway-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
annotations:
description: "Service for the Mifos message-gateway (SMS & messaging) component"
labels:
app: message-gateway
tier: backend
name: message-gateway
spec:
ports:
- name: http
protocol: TCP
port: 9191
targetPort: 9191
- name: callback
protocol: TCP
port: 5009
targetPort: 5009
selector:
app: message-gateway
Loading