FINERACT-2421: Fix kubernetes minikube example configuration
This commit is contained in:
@@ -203,6 +203,26 @@ git clone https://github.com/apache/fineract.git
|
|||||||
cd fineract/kubernetes
|
cd fineract/kubernetes
|
||||||
minikube start
|
minikube start
|
||||||
./kubectl-startup.sh
|
./kubectl-startup.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Wait for all pods to be ready:
|
||||||
|
```bash
|
||||||
|
kubectl get pods -w
|
||||||
|
```
|
||||||
|
|
||||||
|
Once all pods are running, access the Mifos web application:
|
||||||
|
```bash
|
||||||
|
minikube service mifos-community
|
||||||
|
```
|
||||||
|
|
||||||
|
This opens the Mifos X web application in your browser. The nginx reverse proxy in the mifos-community pod forwards API requests to the fineract-server backend.
|
||||||
|
|
||||||
|
**Default credentials:**
|
||||||
|
- Username: `mifos`
|
||||||
|
- Password: `password`
|
||||||
|
|
||||||
|
You can also access the Fineract API directly:
|
||||||
|
```bash
|
||||||
minikube service fineract-server --url --https
|
minikube service fineract-server --url --https
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -210,14 +230,22 @@ Fineract is now running at the printed URL, which you can check e.g. using:
|
|||||||
```bash
|
```bash
|
||||||
http --verify=no --timeout 240 --check-status get $(minikube service fineract-server --url --https)/fineract-provider/actuator/health
|
http --verify=no --timeout 240 --check-status get $(minikube service fineract-server --url --https)/fineract-provider/actuator/health
|
||||||
```
|
```
|
||||||
|
|
||||||
To check the status of your containers on your local minikube Kubernetes cluster, run:
|
To check the status of your containers on your local minikube Kubernetes cluster, run:
|
||||||
```bash
|
```bash
|
||||||
minikube dashboard
|
minikube dashboard
|
||||||
```
|
```
|
||||||
|
|
||||||
You can check Fineract logs using:
|
You can check Fineract logs using:
|
||||||
```bash
|
```bash
|
||||||
kubectl logs deployment/fineract-server
|
kubectl logs deployment/fineract-server
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can check Mifos web app logs using:
|
||||||
|
```bash
|
||||||
|
kubectl logs deployment/mifos-community
|
||||||
|
```
|
||||||
|
|
||||||
To shutdown and reset your cluster, run:
|
To shutdown and reset your cluster, run:
|
||||||
```bash
|
```bash
|
||||||
./kubectl-shutdown.sh
|
./kubectl-shutdown.sh
|
||||||
|
|||||||
@@ -17,6 +17,45 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: web-app-config
|
||||||
|
data:
|
||||||
|
environment.json: |
|
||||||
|
{
|
||||||
|
"fineractApiUrls": ["/fineract-provider"],
|
||||||
|
"oauth": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"defaultLanguage": "en-US",
|
||||||
|
"supportedLanguages": ["en-US", "es-MX"],
|
||||||
|
"preloadClients": true
|
||||||
|
}
|
||||||
|
nginx.conf: |
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /fineract-provider/ {
|
||||||
|
proxy_pass https://fineract-server:8443/fineract-provider/;
|
||||||
|
proxy_ssl_verify off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
proxy_redirect https:// http://;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -60,7 +99,7 @@ spec:
|
|||||||
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";']
|
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:
|
containers:
|
||||||
- name: mifos-community
|
- name: mifos-community
|
||||||
image: openmf/community-app:latest
|
image: openmf/web-app:master
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: "1000m"
|
cpu: "1000m"
|
||||||
@@ -68,18 +107,35 @@ spec:
|
|||||||
requests:
|
requests:
|
||||||
cpu: "200m"
|
cpu: "200m"
|
||||||
memory: "0.5Gi"
|
memory: "0.5Gi"
|
||||||
|
volumeMounts:
|
||||||
|
- name: web-app-config
|
||||||
|
mountPath: /usr/share/nginx/html/assets/configuration
|
||||||
|
readOnly: true
|
||||||
|
- name: nginx-config
|
||||||
|
mountPath: /etc/nginx/conf.d/default.conf
|
||||||
|
subPath: nginx.conf
|
||||||
|
readOnly: true
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /
|
||||||
port: 80
|
port: 80
|
||||||
initialDelaySeconds: 90
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 1
|
periodSeconds: 10
|
||||||
|
failureThreshold: 3
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /
|
||||||
port: 80
|
port: 80
|
||||||
initialDelaySeconds: 90
|
initialDelaySeconds: 5
|
||||||
periodSeconds: 1
|
periodSeconds: 10
|
||||||
|
failureThreshold: 3
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
name: mifos-community
|
name: mifos-community
|
||||||
|
volumes:
|
||||||
|
- name: web-app-config
|
||||||
|
configMap:
|
||||||
|
name: web-app-config
|
||||||
|
- name: nginx-config
|
||||||
|
configMap:
|
||||||
|
name: web-app-config
|
||||||
|
|||||||
@@ -64,22 +64,26 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: "1000m"
|
cpu: "1000m"
|
||||||
memory: "1Gi"
|
memory: "2Gi"
|
||||||
requests:
|
requests:
|
||||||
cpu: "200m"
|
cpu: "200m"
|
||||||
memory: "0.5Gi"
|
memory: "1Gi"
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /fineract-provider/actuator/health/liveness
|
path: /fineract-provider/actuator/health/liveness
|
||||||
port: 8080
|
port: 8443
|
||||||
initialDelaySeconds: 180
|
scheme: HTTPS
|
||||||
periodSeconds: 1
|
initialDelaySeconds: 90
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 3
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /fineract-provider/actuator/health/readiness
|
path: /fineract-provider/actuator/health/readiness
|
||||||
port: 8080
|
port: 8443
|
||||||
initialDelaySeconds: 180
|
scheme: HTTPS
|
||||||
periodSeconds: 1
|
initialDelaySeconds: 60
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 3
|
||||||
env:
|
env:
|
||||||
- name: FINERACT_NODE_ID
|
- name: FINERACT_NODE_ID
|
||||||
value: '1'
|
value: '1'
|
||||||
@@ -113,8 +117,10 @@ spec:
|
|||||||
key: password
|
key: password
|
||||||
- name: FINERACT_DEFAULT_TENANTDB_CONN_PARAMS
|
- name: FINERACT_DEFAULT_TENANTDB_CONN_PARAMS
|
||||||
value: ''
|
value: ''
|
||||||
|
- name: FINERACT_SERVER_PORT
|
||||||
|
value: "8443"
|
||||||
- name: JAVA_TOOL_OPTIONS
|
- name: JAVA_TOOL_OPTIONS
|
||||||
value: '-Xmx1G'
|
value: '-Xmx1G -XX:MaxMetaspaceSize=256m'
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8443
|
- containerPort: 8443
|
||||||
name: fineract-server
|
name: fineract-server
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ spec:
|
|||||||
key: password
|
key: password
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
exec:
|
exec:
|
||||||
command: ["sh","-c","mysqladmin ping -h localhost -uroot -p${MARIADB_ROOT_PASSWORD}"]
|
command: ["sh","-c","mariadb -uroot -p${MARIADB_ROOT_PASSWORD} -e 'SELECT 1'"]
|
||||||
failureThreshold: 10
|
failureThreshold: 10
|
||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
@@ -111,7 +111,7 @@ spec:
|
|||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- mysqladmin ping -uroot -p${MARIADB_ROOT_PASSWORD}
|
- mariadb -uroot -p${MARIADB_ROOT_PASSWORD} -e 'SELECT 1'
|
||||||
failureThreshold: 10
|
failureThreshold: 10
|
||||||
initialDelaySeconds: 5
|
initialDelaySeconds: 5
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
|
|||||||
@@ -18,8 +18,20 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
kubectl delete secret fineract-tenants-db-secret
|
echo "Shutting down Fineract Kubernetes deployment..."
|
||||||
kubectl delete -f fineractmysql-configmap.yml
|
|
||||||
kubectl delete -f fineractmysql-deployment.yml
|
echo "Deleting mifos-community..."
|
||||||
kubectl delete -f fineract-server-deployment.yml
|
kubectl delete -f fineract-mifoscommunity-deployment.yml --ignore-not-found=true
|
||||||
kubectl delete -f fineract-mifoscommunity-deployment.yml
|
|
||||||
|
echo "Deleting fineract-server..."
|
||||||
|
kubectl delete -f fineract-server-deployment.yml --ignore-not-found=true
|
||||||
|
|
||||||
|
echo "Deleting fineractmysql..."
|
||||||
|
kubectl delete -f fineractmysql-deployment.yml --ignore-not-found=true
|
||||||
|
kubectl delete -f fineractmysql-configmap.yml --ignore-not-found=true
|
||||||
|
|
||||||
|
echo "Deleting secrets..."
|
||||||
|
kubectl delete secret fineract-tenants-db-secret --ignore-not-found=true
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Fineract Kubernetes deployment has been shut down."
|
||||||
|
|||||||
@@ -18,53 +18,56 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
echo "Setting Up Fineract service configuration..."
|
set -e
|
||||||
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)
|
|
||||||
|
echo "Setting up Fineract service configuration..."
|
||||||
|
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) 2>/dev/null || echo "Secret already exists, skipping..."
|
||||||
kubectl apply -f fineractmysql-configmap.yml
|
kubectl apply -f fineractmysql-configmap.yml
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Starting fineractmysql..."
|
echo "Starting fineractmysql..."
|
||||||
kubectl apply -f fineractmysql-deployment.yml
|
kubectl apply -f fineractmysql-deployment.yml
|
||||||
|
|
||||||
fineractmysql_pod=""
|
echo "Waiting for fineractmysql to be ready..."
|
||||||
while [[ ${#fineractmysql_pod} -eq 0 ]]; do
|
kubectl wait --for=condition=ready pod -l tier=fineractmysql --timeout=300s
|
||||||
fineractmysql_pod=$(kubectl get pods -l tier=fineractmysql --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
|
|
||||||
done
|
|
||||||
|
|
||||||
fineractmysql_status=$(kubectl get pods ${fineractmysql_pod} --no-headers -o custom-columns=":status.phase")
|
|
||||||
while [[ ${fineractmysql_status} -ne 'Running' ]]; do
|
|
||||||
sleep 1
|
|
||||||
fineractmysql_status=$(kubectl get pods ${fineractmysql_pod} --no-headers -o custom-columns=":status.phase")
|
|
||||||
done
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Starting fineract server..."
|
echo "Starting fineract server..."
|
||||||
kubectl apply -f fineract-server-deployment.yml
|
kubectl apply -f fineract-server-deployment.yml
|
||||||
|
|
||||||
fineract_server_pod=""
|
echo "Waiting for fineract-server to be ready..."
|
||||||
while [[ ${#fineract_server_pod} -eq 0 ]]; do
|
kubectl wait --for=condition=ready pod -l app=fineract-server --timeout=300s
|
||||||
fineract_server_pod=$(kubectl get pods -l tier=backend --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
|
|
||||||
done
|
|
||||||
|
|
||||||
fineract_server_status=$(kubectl get pods ${fineract_server_pod} --no-headers -o custom-columns=":status.phase")
|
|
||||||
while [[ ${fineract_server_status} -ne 'Running' ]]; do
|
|
||||||
sleep 1
|
|
||||||
fineract_server_status=$(kubectl get pods ${fineract_server_pod} --no-headers -o custom-columns=":status.phase")
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Fineract server is up and running"
|
echo "Fineract server is up and running"
|
||||||
|
|
||||||
|
echo
|
||||||
echo "Starting Mifos Community UI..."
|
echo "Starting Mifos Community UI..."
|
||||||
kubectl apply -f fineract-mifoscommunity-deployment.yml
|
kubectl apply -f fineract-mifoscommunity-deployment.yml
|
||||||
|
|
||||||
fineract_mifoscommunity_pod=""
|
echo "Waiting for mifos-community to be ready..."
|
||||||
while [[ ${#fineract_mifoscommunity_pod} -eq 0 ]]; do
|
kubectl wait --for=condition=ready pod -l app=mifos-community --timeout=300s
|
||||||
fineract_mifoscommunity_pod=$(kubectl get pods -l tier=backend --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
|
|
||||||
done
|
|
||||||
|
|
||||||
fineract_mifoscommunity_status=$(kubectl get pods ${fineract_mifoscommunity_pod} --no-headers -o custom-columns=":status.phase")
|
|
||||||
while [[ ${fineract_mifoscommunity_status} -ne 'Running' ]]; do
|
|
||||||
sleep 1
|
|
||||||
fineract_mifoscommunity_status=$(kubectl get pods ${fineract_mifoscommunity_pod} --no-headers -o custom-columns=":status.phase")
|
|
||||||
done
|
|
||||||
echo "Mifos Community UI is up and running"
|
echo "Mifos Community UI is up and running"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "============================================"
|
||||||
|
echo "Fineract Kubernetes deployment is ready!"
|
||||||
|
echo "============================================"
|
||||||
|
echo
|
||||||
|
echo "To access the Mifos web application:"
|
||||||
|
echo " minikube service mifos-community"
|
||||||
|
echo
|
||||||
|
echo "To access the Fineract API directly:"
|
||||||
|
echo " minikube service fineract-server --url --https"
|
||||||
|
echo
|
||||||
|
echo "Default credentials:"
|
||||||
|
echo " Username: mifos"
|
||||||
|
echo " Password: password"
|
||||||
|
echo
|
||||||
|
echo "To check pod status:"
|
||||||
|
echo " kubectl get pods"
|
||||||
|
echo
|
||||||
|
echo "To view logs:"
|
||||||
|
echo " kubectl logs deployment/fineract-server"
|
||||||
|
echo " kubectl logs deployment/mifos-community"
|
||||||
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user