BLasan commented on a change in pull request #1623:
URL: https://github.com/apache/fineract/pull/1623#discussion_r590165099



##########
File path: helm/fineract/templates/fineract-server-deployment.yml
##########
@@ -0,0 +1,87 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ .Release.Name }}-backend
+  namespace: {{ .Release.Namespace }}
+  labels:
+    app: fineract
+    tier: backend
+spec:
+  replicas: {{ .Values.replicas }}
+  selector:
+    matchLabels:
+      app: fineract-backend
+      tier: backend
+      instance: {{ .Release.Name }}
+  template:
+    metadata:
+      labels:
+        app: fineract-backend
+        tier: backend
+        instance: {{ .Release.Name }}
+      annotations:
+        checksum/secrets: {{ include "secrets" . | sha256sum }}
+    spec:
+      initContainers:
+        - name: wait-db
+          image: jwilder/dockerize
+          imagePullPolicy: IfNotPresent
+          args:
+          - -wait
+          - tcp://{{ include "mysql_host" . }}:3306
+          - -timeout
+          - 300s
+      containers:
+        - name: fineract-backend
+          image: "{{ .Values.fineractServer.image.name }}:{{ 
.Values.fineractServer.image.tag }}"
+          envFrom:
+            - secretRef:
+                name: {{ .Release.Name | quote }}
+          env:
+            - name: FINERACT_DEFAULT_TENANTDB_HOSTNAME
+              value: {{ include "mysql_host" . }}
+            - name: fineract_tenants_url
+              value: {{ include "mysql_url" . }}
+            - name: fineract_tenants_uid
+              value: {{ include "mysql_user" . }}
+            - name: FINERACT_DEFAULT_TENANTDB_UID
+              value: {{ include "mysql_user" . }}
+            {{ if .Values.fineractServer.extraEnv }}
+            {{- range $key, $value := .Values.fineractServer.extraEnv }}
+            - name: {{ $key | quote}}
+              value: {{ $value | quote }}
+            {{- end }}
+            {{- end }}
+          ports:
+            - containerPort: 8080
+              name: http
+          readinessProbe:

Review comment:
       You can use separate paths to check liveness and readiness probes. We 
have added configurations in to spring boot. See 
https://github.com/apache/fineract/pull/1649

##########
File path: helm/fineract/values.yaml
##########
@@ -0,0 +1,83 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# TODO: add option to install ActiveMQ?
+
+fineractServer:
+  replicas: 1
+  image:
+    name: apache/fineract
+    tag: latest
+  # key/value pairs to pass as environment variables to the backend pods
+  extraEnv:
+    DRIVERCLASS_NAME: org.drizzle.jdbc.DrizzleDriver
+    PROTOCOL: jdbc
+    SUB_PROTOCOL: mysql:thin
+    fineract_tenants_driver: org.drizzle.jdbc.DrizzleDriver
+    FINERACT_DEFAULT_TENANTDB_PORT: "3306"
+  # sensitive key/value pairs to pass as environment variables to the backend 
pods as secrets
+  extraSecretEnv: {}
+
+fineractUI:
+  replicas: 1
+  image:
+    name: openmf/community-app
+    tag: latest
+
+# Globals will be available to subcharts
+global:
+  db:
+    tenantsDb: fineract_tenants
+    defaultDb: fineract_default
+
+# Any other parameter from https://artifacthub.io/packages/helm/bitnami/mysql
+mysql:
+  enabled: true
+  # Required because db driver doesn't support mysql 8...
+  image:
+    tag: '5.7'
+  auth:
+    # Please change these...
+    rootPassword: ozIRdODs8Jvs3BzZywgK
+    password: ihcqsCcsX6

Review comment:
       I don't know whether the following line would generate a proper random 
password. You can try this to generate the mysql password @Yann-J 
   
   `password: {{ randAlphaNum 64 | quote }}`
   
   Or else we can point a particular secret name to the get password. But in 
order to do that we need to create that secret first before installing helm 
chart
   Refer: 
https://stackoverflow.com/questions/56170052/how-not-to-overwrite-randomly-generated-secrets-in-helm-templates

##########
File path: helm/fineract/templates/fineract-server-deployment.yml
##########
@@ -0,0 +1,87 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ .Release.Name }}-backend
+  namespace: {{ .Release.Namespace }}
+  labels:
+    app: fineract
+    tier: backend
+spec:
+  replicas: {{ .Values.replicas }}
+  selector:
+    matchLabels:
+      app: fineract-backend
+      tier: backend
+      instance: {{ .Release.Name }}
+  template:
+    metadata:
+      labels:
+        app: fineract-backend
+        tier: backend
+        instance: {{ .Release.Name }}
+      annotations:
+        checksum/secrets: {{ include "secrets" . | sha256sum }}
+    spec:
+      initContainers:
+        - name: wait-db
+          image: jwilder/dockerize
+          imagePullPolicy: IfNotPresent
+          args:
+          - -wait
+          - tcp://{{ include "mysql_host" . }}:3306
+          - -timeout
+          - 300s
+      containers:
+        - name: fineract-backend
+          image: "{{ .Values.fineractServer.image.name }}:{{ 
.Values.fineractServer.image.tag }}"
+          envFrom:
+            - secretRef:
+                name: {{ .Release.Name | quote }}
+          env:
+            - name: FINERACT_DEFAULT_TENANTDB_HOSTNAME
+              value: {{ include "mysql_host" . }}
+            - name: fineract_tenants_url
+              value: {{ include "mysql_url" . }}
+            - name: fineract_tenants_uid
+              value: {{ include "mysql_user" . }}
+            - name: FINERACT_DEFAULT_TENANTDB_UID
+              value: {{ include "mysql_user" . }}
+            {{ if .Values.fineractServer.extraEnv }}
+            {{- range $key, $value := .Values.fineractServer.extraEnv }}
+            - name: {{ $key | quote}}
+              value: {{ $value | quote }}
+            {{- end }}
+            {{- end }}

Review comment:
       I think you have missed this env.
   ```
           - name: FINERACT_DEFAULT_TENANTDB_PWD
             valueFrom:
               secretKeyRef:
                 name: fineract-tenants-db-secret
                 key: password
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to