From ccff5d8ad23a3b446846e5e84f973994d022feed Mon Sep 17 00:00:00 2001 From: Petri Tuomola Date: Thu, 30 Dec 2021 10:14:17 +0800 Subject: [PATCH] FINERACT-1457: Change Kubernetes set-up to use MariaDB --- .../fineract-mifoscommunity-deployment.yml | 28 +++++++++---------- kubernetes/fineract-server-deployment.yml | 2 +- kubernetes/fineractmysql-deployment.yml | 8 +++--- kubernetes/kubectl-startup.sh | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/kubernetes/fineract-mifoscommunity-deployment.yml b/kubernetes/fineract-mifoscommunity-deployment.yml index 3bf43218a..eeb13fc1b 100644 --- a/kubernetes/fineract-mifoscommunity-deployment.yml +++ b/kubernetes/fineract-mifoscommunity-deployment.yml @@ -21,15 +21,15 @@ apiVersion: v1 kind: Service metadata: labels: - app: fineract-mifoscommunity - name: fineract-mifoscommunity + app: mifos-community + name: mifos-community spec: ports: - protocol: TCP - port: 80 + port: 9090 targetPort: 80 selector: - app: fineract-mifoscommunity + app: mifos-community tier: frontend type: LoadBalancer @@ -38,20 +38,20 @@ spec: apiVersion: apps/v1 kind: Deployment metadata: - name: fineract-mifoscommunity + name: mifos-community labels: - app: fineract-mifoscommunity + app: mifos-community spec: selector: matchLabels: - app: fineract-mifoscommunity + app: mifos-community tier: frontend strategy: type: Recreate template: metadata: labels: - app: fineract-mifoscommunity + app: mifos-community tier: frontend spec: initContainers: @@ -59,7 +59,7 @@ spec: image: busybox:1.28 command: ['sh', '-c', 'echo -e "Checking for the availability of Fineract server deployment"; while ! nc -z "fineract-server" 8443; do sleep 1; printf "-"; done; echo -e " >> Fineract server has started";'] containers: - - name: fineract-mifoscommunity + - name: mifos-community image: openmf/community-app:latest resources: limits: @@ -70,16 +70,16 @@ spec: memory: "0.5Gi" livenessProbe: httpGet: - path: /# - port: 9090 + path: / + port: 80 initialDelaySeconds: 90 periodSeconds: 1 readinessProbe: httpGet: - path: /# - port: 9090 + path: / + port: 80 initialDelaySeconds: 90 periodSeconds: 1 ports: - containerPort: 80 - name: fineract-mifoscommunity + name: mifos-community diff --git a/kubernetes/fineract-server-deployment.yml b/kubernetes/fineract-server-deployment.yml index 0179d89c5..6b45ab8e1 100644 --- a/kubernetes/fineract-server-deployment.yml +++ b/kubernetes/fineract-server-deployment.yml @@ -88,7 +88,7 @@ spec: - name: SUB_PROTOCOL value: mariadb - name: node_id - value: 1 + value: '1' - name: fineract_tenants_driver value: org.mariadb.jdbc.Driver - name: fineract_tenants_url diff --git a/kubernetes/fineractmysql-deployment.yml b/kubernetes/fineractmysql-deployment.yml index d44fbbdf0..81ff40dcd 100644 --- a/kubernetes/fineractmysql-deployment.yml +++ b/kubernetes/fineractmysql-deployment.yml @@ -86,7 +86,7 @@ spec: tier: fineractmysql spec: containers: - - image: mysql:5.7 + - image: mariadb:10.6 name: mysql resources: requests: @@ -96,14 +96,14 @@ spec: memory: "5Gi" cpu: "2000m" env: - - name: MYSQL_ROOT_PASSWORD + - name: MARIADB_ROOT_PASSWORD valueFrom: secretKeyRef: name: fineract-tenants-db-secret key: password livenessProbe: exec: - command: ["sh","-c","mysqladmin ping -h localhost -uroot -p${MYSQL_ROOT_PASSWORD}"] + command: ["sh","-c","mysqladmin ping -h localhost -uroot -p${MARIADB_ROOT_PASSWORD}"] failureThreshold: 10 timeoutSeconds: 10 readinessProbe: @@ -111,7 +111,7 @@ spec: command: - sh - -c - - mysqladmin ping -uroot -p${MYSQL_PASSWORD} + - mysqladmin ping -uroot -p${MARIADB_ROOT_PASSWORD} failureThreshold: 10 initialDelaySeconds: 5 periodSeconds: 5 diff --git a/kubernetes/kubectl-startup.sh b/kubernetes/kubectl-startup.sh index f52306f9f..8ca9055f4 100755 --- a/kubernetes/kubectl-startup.sh +++ b/kubernetes/kubectl-startup.sh @@ -19,7 +19,7 @@ # echo "Setting Up Fineract service configuration..." -kubectl create secret generic fineract-tenants-db-secret --from-literal=username=root --from-literal=password=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16) +kubectl create secret generic fineract-tenants-db-secret --from-literal=username=root --from-literal=password=$(head /dev/urandom | LC_CTYPE=C tr -dc A-Za-z0-9 | head -c 16) kubectl apply -f fineractmysql-configmap.yml echo