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
|
||||
minikube start
|
||||
./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
|
||||
```
|
||||
|
||||
@@ -210,14 +230,22 @@ Fineract is now running at the printed URL, which you can check e.g. using:
|
||||
```bash
|
||||
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:
|
||||
```bash
|
||||
minikube dashboard
|
||||
```
|
||||
|
||||
You can check Fineract logs using:
|
||||
```bash
|
||||
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:
|
||||
```bash
|
||||
./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
|
||||
kind: Service
|
||||
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";']
|
||||
containers:
|
||||
- name: mifos-community
|
||||
image: openmf/community-app:latest
|
||||
image: openmf/web-app:master
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1000m"
|
||||
@@ -68,18 +107,35 @@ spec:
|
||||
requests:
|
||||
cpu: "200m"
|
||||
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:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 90
|
||||
periodSeconds: 1
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 90
|
||||
periodSeconds: 1
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
ports:
|
||||
- containerPort: 80
|
||||
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:
|
||||
limits:
|
||||
cpu: "1000m"
|
||||
memory: "1Gi"
|
||||
memory: "2Gi"
|
||||
requests:
|
||||
cpu: "200m"
|
||||
memory: "0.5Gi"
|
||||
memory: "1Gi"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /fineract-provider/actuator/health/liveness
|
||||
port: 8080
|
||||
initialDelaySeconds: 180
|
||||
periodSeconds: 1
|
||||
port: 8443
|
||||
scheme: HTTPS
|
||||
initialDelaySeconds: 90
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /fineract-provider/actuator/health/readiness
|
||||
port: 8080
|
||||
initialDelaySeconds: 180
|
||||
periodSeconds: 1
|
||||
port: 8443
|
||||
scheme: HTTPS
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
env:
|
||||
- name: FINERACT_NODE_ID
|
||||
value: '1'
|
||||
@@ -113,8 +117,10 @@ spec:
|
||||
key: password
|
||||
- name: FINERACT_DEFAULT_TENANTDB_CONN_PARAMS
|
||||
value: ''
|
||||
- name: FINERACT_SERVER_PORT
|
||||
value: "8443"
|
||||
- name: JAVA_TOOL_OPTIONS
|
||||
value: '-Xmx1G'
|
||||
value: '-Xmx1G -XX:MaxMetaspaceSize=256m'
|
||||
ports:
|
||||
- containerPort: 8443
|
||||
name: fineract-server
|
||||
|
||||
@@ -103,7 +103,7 @@ spec:
|
||||
key: password
|
||||
livenessProbe:
|
||||
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
|
||||
timeoutSeconds: 10
|
||||
readinessProbe:
|
||||
@@ -111,7 +111,7 @@ spec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- mysqladmin ping -uroot -p${MARIADB_ROOT_PASSWORD}
|
||||
- mariadb -uroot -p${MARIADB_ROOT_PASSWORD} -e 'SELECT 1'
|
||||
failureThreshold: 10
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
|
||||
@@ -18,8 +18,20 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
kubectl delete secret fineract-tenants-db-secret
|
||||
kubectl delete -f fineractmysql-configmap.yml
|
||||
kubectl delete -f fineractmysql-deployment.yml
|
||||
kubectl delete -f fineract-server-deployment.yml
|
||||
kubectl delete -f fineract-mifoscommunity-deployment.yml
|
||||
echo "Shutting down Fineract Kubernetes deployment..."
|
||||
|
||||
echo "Deleting mifos-community..."
|
||||
kubectl delete -f fineract-mifoscommunity-deployment.yml --ignore-not-found=true
|
||||
|
||||
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.
|
||||
#
|
||||
|
||||
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)
|
||||
set -e
|
||||
|
||||
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
|
||||
|
||||
echo
|
||||
echo "Starting fineractmysql..."
|
||||
kubectl apply -f fineractmysql-deployment.yml
|
||||
|
||||
fineractmysql_pod=""
|
||||
while [[ ${#fineractmysql_pod} -eq 0 ]]; do
|
||||
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 "Waiting for fineractmysql to be ready..."
|
||||
kubectl wait --for=condition=ready pod -l tier=fineractmysql --timeout=300s
|
||||
|
||||
echo
|
||||
echo "Starting fineract server..."
|
||||
kubectl apply -f fineract-server-deployment.yml
|
||||
|
||||
fineract_server_pod=""
|
||||
while [[ ${#fineract_server_pod} -eq 0 ]]; do
|
||||
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 "Waiting for fineract-server to be ready..."
|
||||
kubectl wait --for=condition=ready pod -l app=fineract-server --timeout=300s
|
||||
|
||||
echo "Fineract server is up and running"
|
||||
|
||||
echo
|
||||
echo "Starting Mifos Community UI..."
|
||||
kubectl apply -f fineract-mifoscommunity-deployment.yml
|
||||
|
||||
fineract_mifoscommunity_pod=""
|
||||
while [[ ${#fineract_mifoscommunity_pod} -eq 0 ]]; do
|
||||
fineract_mifoscommunity_pod=$(kubectl get pods -l tier=backend --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
|
||||
done
|
||||
echo "Waiting for mifos-community to be ready..."
|
||||
kubectl wait --for=condition=ready pod -l app=mifos-community --timeout=300s
|
||||
|
||||
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
|
||||
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