Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Commit 1b6765d

Browse files
authored
Merge pull request #26 from BLasan/k8s-helm
Add: Helm Chart Configurations for Fineract CN
2 parents 0551702 + 478da39 commit 1b6765d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3214
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.env
2+
/kubernetes_scripts/Fineract-CN-Helm/*.tgz
3+
/kubernetes_scripts/Fineract-CN-Helm/fineract-cn/charts/*.tgz

Fineract-CN-Helm/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Creating Helm Chart
2+
3+
By running the following commands the helm chart for Fineract-CN can be generated and deployed on a Kubernetes Cluster.
4+
5+
1. `helm dep up fineract-cn`
6+
7+
2. `helm package fineract-cn`
8+
9+
3. `helm repo index .`
10+
11+
4. Create Secret Config
12+
13+
export config_param=$( java -cp ./external_tools/lang-0.1.0-BUILD-SNAPSHOT.jar \
14+
org.apache.fineract.cn.lang.security.RsaKeyPairFactory UNIX | \
15+
sed -e 's/^[ \t]*//' | awk '{print "--from-literal="$1}' )
16+
...
17+
kubectl create configmap secret-config ${config_param} -n fineract-cn
18+
19+
5. `helm install fineract-cn ./fineract-cn/ --namespace="fineract-cn" --create-namespace`
Binary file not shown.
47.4 KB
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
appVersion: "1.0"
3+
description: Fineract CN
4+
name: fineract-cn
5+
version: 1.0.0-SNAPSHOT
6+
dependencies:
7+
- name: postgresql
8+
version: 9.5
9+
repository: "https://charts.bitnami.com/bitnami"
10+
alias: postgres
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: postgresql
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 9.5.0
5+
digest: sha256:08c7f73b05c9b67ba47786a630ff8c2bae0cc07e752938e186f81417e62e67d8
6+
generated: "2022-04-19T02:45:02.064569341+05:30"
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: accounting-service
5+
namespace: {{ .Values.namespace }}
6+
spec:
7+
selector:
8+
app: accounting-ms
9+
ports:
10+
- port: 2025
11+
targetPort: 2025
12+
# type: LoadBalancer
13+
14+
---
15+
16+
apiVersion: apps/v1
17+
kind: Deployment
18+
metadata:
19+
name: accounting-ms-cluster
20+
namespace: {{ .Values.namespace }}
21+
spec:
22+
replicas: 1
23+
selector:
24+
matchLabels:
25+
app: accounting-ms
26+
strategy:
27+
rollingUpdate:
28+
maxSurge: 25%
29+
maxUnavailable: 25%
30+
type: RollingUpdate
31+
template:
32+
metadata:
33+
labels:
34+
app: accounting-ms
35+
spec:
36+
containers:
37+
- name: fineract-cn-accounting
38+
image: {{ .Values.accounting.image }}
39+
imagePullPolicy: IfNotPresent
40+
envFrom:
41+
- configMapRef:
42+
name: external-tools-config
43+
- configMapRef:
44+
name: fineract-service-config
45+
env:
46+
- name: kubernetes.service.name
47+
value: accounting-service
48+
- name: server.port
49+
value: "2025"
50+
- name: spring.application.name
51+
value: accounting-v1
52+
- name: system.publicKey.modulus
53+
valueFrom:
54+
configMapKeyRef:
55+
key: PUBLIC_KEY_MODULUS
56+
name: secret-config
57+
- name: system.publicKey.exponent
58+
valueFrom:
59+
configMapKeyRef:
60+
key: PUBLIC_KEY_EXPONENT
61+
name: secret-config
62+
- name: system.publicKey.timestamp
63+
valueFrom:
64+
configMapKeyRef:
65+
key: PUBLIC_KEY_TIMESTAMP
66+
name: secret-config
67+
- name: system.privateKey.modulus
68+
valueFrom:
69+
configMapKeyRef:
70+
key: PRIVATE_KEY_MODULUS
71+
name: secret-config
72+
- name: system.privateKey.exponent
73+
valueFrom:
74+
configMapKeyRef:
75+
key: PRIVATE_KEY_EXPONENT
76+
name: secret-config
77+
ports:
78+
- containerPort: 2025
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: activemq-cluster
5+
namespace: {{ .Values.namespace }}
6+
spec:
7+
selector:
8+
app: activemq
9+
ports:
10+
- name: external-port
11+
port: 8161
12+
targetPort: 8161
13+
- name: internal-port
14+
port: 61616
15+
protocol: TCP
16+
targetPort: 61616
17+
type: LoadBalancer
18+
19+
---
20+
21+
apiVersion: apps/v1
22+
kind: Deployment
23+
metadata:
24+
name: activemq-cluster
25+
namespace: {{ .Values.namespace }}
26+
spec:
27+
replicas: 1
28+
selector:
29+
matchLabels:
30+
app: activemq
31+
strategy:
32+
rollingUpdate:
33+
maxSurge: 25%
34+
maxUnavailable: 25%
35+
type: RollingUpdate
36+
template:
37+
metadata:
38+
labels:
39+
app: activemq
40+
spec:
41+
containers:
42+
- image: {{ .Values.activemq.image }}
43+
imagePullPolicy: IfNotPresent
44+
name: activemq
45+
ports:
46+
- containerPort: 61616
47+
- containerPort: 8161
48+
env:
49+
- name: ACTIVEMQ_CONFIG_MINMEMORY
50+
value: "512"
51+
- name: ACTIVEMQ_CONFIG_MAXMEMORY
52+
value: "1024"
53+
livenessProbe:
54+
httpGet:
55+
path: /
56+
port: 8161
57+
initialDelaySeconds: 45
58+
timeoutSeconds: 10
59+
periodSeconds: 60
60+
failureThreshold: 3
61+
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# apiVersion: v1
2+
# kind: PersistentVolume
3+
# metadata:
4+
# name: cassandra-pv
5+
# spec:
6+
# accessModes:
7+
# - ReadWriteOnce
8+
# capacity:
9+
# storage: 10Gi
10+
# persistentVolumeReclaimPolicy: Retain
11+
# storageClassName: standard
12+
# gcePersistentDisk:
13+
# fsType: ext4
14+
# pdName: apache-fineract-pd
15+
16+
# ---
17+
18+
apiVersion: v1
19+
kind: PersistentVolumeClaim
20+
metadata:
21+
name: cassandra-pvc
22+
namespace: {{ .Values.namespace }}
23+
spec:
24+
accessModes:
25+
- ReadWriteOnce
26+
resources:
27+
requests:
28+
storage: 10Gi
29+
# volumeName: cassandra-pv
30+
31+
---
32+
33+
apiVersion: v1
34+
kind: Service
35+
metadata:
36+
name: cassandra-cluster
37+
namespace: {{ .Values.namespace }}
38+
spec:
39+
selector:
40+
app: cassandra
41+
ports:
42+
- port: 9042
43+
targetPort: 9042
44+
type: LoadBalancer
45+
46+
---
47+
48+
apiVersion: apps/v1
49+
kind: Deployment
50+
metadata:
51+
name: cassandra-cluster
52+
namespace: {{ .Values.namespace }}
53+
spec:
54+
replicas: 1
55+
selector:
56+
matchLabels:
57+
app: cassandra
58+
strategy:
59+
rollingUpdate:
60+
maxSurge: 25%
61+
maxUnavailable: 25%
62+
type: RollingUpdate
63+
template:
64+
metadata:
65+
labels:
66+
app: cassandra
67+
spec:
68+
containers:
69+
- image: {{ .Values.cassandra.image }}
70+
imagePullPolicy: IfNotPresent
71+
name: cassandra
72+
ports:
73+
- containerPort: 9042
74+
name: cql
75+
livenessProbe:
76+
exec:
77+
command:
78+
- cqlsh
79+
- --help
80+
initialDelaySeconds: 10
81+
timeoutSeconds: 1
82+
periodSeconds: 10
83+
failureThreshold: 3
84+
volumeMounts:
85+
- mountPath: /var/lib/cassandra
86+
name: cassandra-storage
87+
volumes:
88+
- name: cassandra-storage
89+
persistentVolumeClaim:
90+
claimName: cassandra-pvc
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: fineract-service-config
5+
namespace: {{ .Values.namespace }}
6+
data:
7+
bonecp.acquireIncrement: "1" #Might be absent for identity
8+
bonecp.maxConnectionsPerPartition: "4" #Might be absent for identity
9+
bonecp.minConnectionsPerPartition: "1" #Might be absent for identity
10+
bonecp.partitionCount: "1" #Might be absent for identity
11+
cassandra.cl.delete: ONE
12+
cassandra.cl.read: ONE
13+
cassandra.cl.write: ONE
14+
cassandra.cluster.pwd: password
15+
cassandra.cluster.user: cassandra
16+
cassandra.clusterName: datacenter1
17+
cassandra.keyspace: seshat
18+
eureka.client.fetchRegistry: "true"
19+
eureka.client.initialInstanceInfoReplicationIntervalSeconds: "25"
20+
eureka.client.instanceInfoReplicationIntervalSeconds: "20"
21+
eureka.instance.leaseRenewalIntervalInSeconds: "20"
22+
eureka.registration.enabled: "false"
23+
feign.hystrix.enabled: "false"
24+
postgresql.database: seshat #Might be absent for identity
25+
ribbon.eureka.enabled: "false"
26+
server.max-http-header-size: "16384"
27+
spring.cloud.config.enabled: "false"
28+
spring.cloud.discovery.enabled: "true"
29+
keycloak.enabled: "false"
30+
authentication.service.keycloak: "false"
31+
authentication.service.anubis: "true"
32+
keycloak.auth-server-url: "https://localhost:8180/auth"
33+
keycloak.ssl-required: "external"
34+
keycloak.confidential-port: "443"
35+
keycloak.realm: "keycloak-realm"
36+
keycloak.resource: "kecloak-client"
37+
keycloak.public-client: "true"
38+
keycloak.principal-attribute: "preferred_username"
39+
keycloak.bearer-only: "true"
40+
conf.enableAccountLevelAccessVerification: "false"
41+
fin.keycloak.realm.publicKey: "keycloak-rsa-public-key"
42+
keycloak.use-resource-role-mappings: "true"
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: customer-service
5+
namespace: {{ .Values.namespace }}
6+
spec:
7+
selector:
8+
app: customer-ms
9+
ports:
10+
- port: 2024
11+
targetPort: 2024
12+
# type: LoadBalancer
13+
14+
---
15+
16+
apiVersion: apps/v1
17+
kind: Deployment
18+
metadata:
19+
name: customer-ms-cluster
20+
namespace: {{ .Values.namespace }}
21+
spec:
22+
replicas: 1
23+
selector:
24+
matchLabels:
25+
app: customer-ms
26+
strategy:
27+
rollingUpdate:
28+
maxSurge: 25%
29+
maxUnavailable: 25%
30+
type: RollingUpdate
31+
template:
32+
metadata:
33+
labels:
34+
app: customer-ms
35+
spec:
36+
containers:
37+
- name: customer-ms
38+
image: {{ .Values.customer.image }}
39+
imagePullPolicy: IfNotPresent
40+
envFrom:
41+
- configMapRef:
42+
name: external-tools-config
43+
- configMapRef:
44+
name: fineract-service-config
45+
env:
46+
- name: kubernetes.service.name
47+
value: customer-service
48+
- name: server.port
49+
value: "2024"
50+
- name: spring.application.name
51+
value: customer-v1
52+
- name: system.publicKey.modulus
53+
valueFrom:
54+
configMapKeyRef:
55+
key: PUBLIC_KEY_MODULUS
56+
name: secret-config
57+
- name: system.publicKey.exponent
58+
valueFrom:
59+
configMapKeyRef:
60+
key: PUBLIC_KEY_EXPONENT
61+
name: secret-config
62+
- name: system.publicKey.timestamp
63+
valueFrom:
64+
configMapKeyRef:
65+
key: PUBLIC_KEY_TIMESTAMP
66+
name: secret-config
67+
- name: system.privateKey.modulus
68+
valueFrom:
69+
configMapKeyRef:
70+
key: PRIVATE_KEY_MODULUS
71+
name: secret-config
72+
- name: system.privateKey.exponent
73+
valueFrom:
74+
configMapKeyRef:
75+
key: PRIVATE_KEY_EXPONENT
76+
name: secret-config
77+
ports:
78+
- containerPort: 2024

0 commit comments

Comments
 (0)