Skip to content
Permalink
Browse files
Merge pull request #26 from BLasan/k8s-helm
Add: Helm Chart Configurations for Fineract CN
  • Loading branch information
fynmanoj committed Jun 28, 2022
2 parents 0551702 + 478da39 commit 1b6765deb37942aedcf8c1a3602d1e9a78548ef6
Showing 57 changed files with 3,214 additions and 0 deletions.
@@ -1 +1,3 @@
.env
/kubernetes_scripts/Fineract-CN-Helm/*.tgz
/kubernetes_scripts/Fineract-CN-Helm/fineract-cn/charts/*.tgz
@@ -0,0 +1,19 @@
# Creating Helm Chart

By running the following commands the helm chart for Fineract-CN can be generated and deployed on a Kubernetes Cluster.

1. `helm dep up fineract-cn`

2. `helm package fineract-cn`

3. `helm repo index .`

4. Create Secret Config

export config_param=$( java -cp ./external_tools/lang-0.1.0-BUILD-SNAPSHOT.jar \
org.apache.fineract.cn.lang.security.RsaKeyPairFactory UNIX | \
sed -e 's/^[ \t]*//' | awk '{print "--from-literal="$1}' )
...
kubectl create configmap secret-config ${config_param} -n fineract-cn

5. `helm install fineract-cn ./fineract-cn/ --namespace="fineract-cn" --create-namespace`
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,10 @@
apiVersion: v1
appVersion: "1.0"
description: Fineract CN
name: fineract-cn
version: 1.0.0-SNAPSHOT
dependencies:
- name: postgresql
version: 9.5
repository: "https://charts.bitnami.com/bitnami"
alias: postgres
Binary file not shown.
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 9.5.0
digest: sha256:08c7f73b05c9b67ba47786a630ff8c2bae0cc07e752938e186f81417e62e67d8
generated: "2022-04-19T02:45:02.064569341+05:30"
@@ -0,0 +1,78 @@
apiVersion: v1
kind: Service
metadata:
name: accounting-service
namespace: {{ .Values.namespace }}
spec:
selector:
app: accounting-ms
ports:
- port: 2025
targetPort: 2025
# type: LoadBalancer

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: accounting-ms-cluster
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: accounting-ms
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: accounting-ms
spec:
containers:
- name: fineract-cn-accounting
image: {{ .Values.accounting.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: external-tools-config
- configMapRef:
name: fineract-service-config
env:
- name: kubernetes.service.name
value: accounting-service
- name: server.port
value: "2025"
- name: spring.application.name
value: accounting-v1
- name: system.publicKey.modulus
valueFrom:
configMapKeyRef:
key: PUBLIC_KEY_MODULUS
name: secret-config
- name: system.publicKey.exponent
valueFrom:
configMapKeyRef:
key: PUBLIC_KEY_EXPONENT
name: secret-config
- name: system.publicKey.timestamp
valueFrom:
configMapKeyRef:
key: PUBLIC_KEY_TIMESTAMP
name: secret-config
- name: system.privateKey.modulus
valueFrom:
configMapKeyRef:
key: PRIVATE_KEY_MODULUS
name: secret-config
- name: system.privateKey.exponent
valueFrom:
configMapKeyRef:
key: PRIVATE_KEY_EXPONENT
name: secret-config
ports:
- containerPort: 2025
@@ -0,0 +1,61 @@
apiVersion: v1
kind: Service
metadata:
name: activemq-cluster
namespace: {{ .Values.namespace }}
spec:
selector:
app: activemq
ports:
- name: external-port
port: 8161
targetPort: 8161
- name: internal-port
port: 61616
protocol: TCP
targetPort: 61616
type: LoadBalancer

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: activemq-cluster
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: activemq
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: activemq
spec:
containers:
- image: {{ .Values.activemq.image }}
imagePullPolicy: IfNotPresent
name: activemq
ports:
- containerPort: 61616
- containerPort: 8161
env:
- name: ACTIVEMQ_CONFIG_MINMEMORY
value: "512"
- name: ACTIVEMQ_CONFIG_MAXMEMORY
value: "1024"
livenessProbe:
httpGet:
path: /
port: 8161
initialDelaySeconds: 45
timeoutSeconds: 10
periodSeconds: 60
failureThreshold: 3

@@ -0,0 +1,90 @@
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: cassandra-pv
# spec:
# accessModes:
# - ReadWriteOnce
# capacity:
# storage: 10Gi
# persistentVolumeReclaimPolicy: Retain
# storageClassName: standard
# gcePersistentDisk:
# fsType: ext4
# pdName: apache-fineract-pd

# ---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cassandra-pvc
namespace: {{ .Values.namespace }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
# volumeName: cassandra-pv

---

apiVersion: v1
kind: Service
metadata:
name: cassandra-cluster
namespace: {{ .Values.namespace }}
spec:
selector:
app: cassandra
ports:
- port: 9042
targetPort: 9042
type: LoadBalancer

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: cassandra-cluster
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: cassandra
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: cassandra
spec:
containers:
- image: {{ .Values.cassandra.image }}
imagePullPolicy: IfNotPresent
name: cassandra
ports:
- containerPort: 9042
name: cql
livenessProbe:
exec:
command:
- cqlsh
- --help
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 10
failureThreshold: 3
volumeMounts:
- mountPath: /var/lib/cassandra
name: cassandra-storage
volumes:
- name: cassandra-storage
persistentVolumeClaim:
claimName: cassandra-pvc
@@ -0,0 +1,42 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: fineract-service-config
namespace: {{ .Values.namespace }}
data:
bonecp.acquireIncrement: "1" #Might be absent for identity
bonecp.maxConnectionsPerPartition: "4" #Might be absent for identity
bonecp.minConnectionsPerPartition: "1" #Might be absent for identity
bonecp.partitionCount: "1" #Might be absent for identity
cassandra.cl.delete: ONE
cassandra.cl.read: ONE
cassandra.cl.write: ONE
cassandra.cluster.pwd: password
cassandra.cluster.user: cassandra
cassandra.clusterName: datacenter1
cassandra.keyspace: seshat
eureka.client.fetchRegistry: "true"
eureka.client.initialInstanceInfoReplicationIntervalSeconds: "25"
eureka.client.instanceInfoReplicationIntervalSeconds: "20"
eureka.instance.leaseRenewalIntervalInSeconds: "20"
eureka.registration.enabled: "false"
feign.hystrix.enabled: "false"
postgresql.database: seshat #Might be absent for identity
ribbon.eureka.enabled: "false"
server.max-http-header-size: "16384"
spring.cloud.config.enabled: "false"
spring.cloud.discovery.enabled: "true"
keycloak.enabled: "false"
authentication.service.keycloak: "false"
authentication.service.anubis: "true"
keycloak.auth-server-url: "https://localhost:8180/auth"
keycloak.ssl-required: "external"
keycloak.confidential-port: "443"
keycloak.realm: "keycloak-realm"
keycloak.resource: "kecloak-client"
keycloak.public-client: "true"
keycloak.principal-attribute: "preferred_username"
keycloak.bearer-only: "true"
conf.enableAccountLevelAccessVerification: "false"
fin.keycloak.realm.publicKey: "keycloak-rsa-public-key"
keycloak.use-resource-role-mappings: "true"
@@ -0,0 +1,78 @@
apiVersion: v1
kind: Service
metadata:
name: customer-service
namespace: {{ .Values.namespace }}
spec:
selector:
app: customer-ms
ports:
- port: 2024
targetPort: 2024
# type: LoadBalancer

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: customer-ms-cluster
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: customer-ms
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: customer-ms
spec:
containers:
- name: customer-ms
image: {{ .Values.customer.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: external-tools-config
- configMapRef:
name: fineract-service-config
env:
- name: kubernetes.service.name
value: customer-service
- name: server.port
value: "2024"
- name: spring.application.name
value: customer-v1
- name: system.publicKey.modulus
valueFrom:
configMapKeyRef:
key: PUBLIC_KEY_MODULUS
name: secret-config
- name: system.publicKey.exponent
valueFrom:
configMapKeyRef:
key: PUBLIC_KEY_EXPONENT
name: secret-config
- name: system.publicKey.timestamp
valueFrom:
configMapKeyRef:
key: PUBLIC_KEY_TIMESTAMP
name: secret-config
- name: system.privateKey.modulus
valueFrom:
configMapKeyRef:
key: PRIVATE_KEY_MODULUS
name: secret-config
- name: system.privateKey.exponent
valueFrom:
configMapKeyRef:
key: PRIVATE_KEY_EXPONENT
name: secret-config
ports:
- containerPort: 2024

0 comments on commit 1b6765d

Please sign in to comment.