Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of Financial portal and settlement services #233

Merged
merged 31 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
369ec81
add finance portal ui chart
Nov 26, 2019
d5a71a3
upgrade portal charts
Nov 28, 2019
afaedec
add db host config to secrets
Nov 29, 2019
c6e4b44
Added charts for settlement
Dec 3, 2019
dc0e97c
add finance portal proxy and quoting service quotes
Dec 3, 2019
7df5f44
Added command for updating `settlement` chart.
Dec 4, 2019
6441afe
Added `settlement` to requirements.yaml
Dec 4, 2019
212dcd2
Fixed issues with `settlement` chart.
Dec 4, 2019
92300e7
add finance-portal charts
Dec 5, 2019
410cbfe
add portal stuff
Dec 5, 2019
a973b97
Used more universal shebang for update script
partiallyordered Dec 5, 2019
a8b82a6
Delete this with extreme prejudice (#231)
Dec 5, 2019
ac7ece8
change settlement ingress ports
Dec 6, 2019
0d83d78
Merge branch 'master' of github.com:mojaloop/helm into mowdev-3414
Dec 6, 2019
335702b
fix finance portal images
Dec 6, 2019
93c7aa1
update services version to current version
Dec 10, 2019
0a7f277
fix settlement endpoints
Dec 12, 2019
247c34e
Merge branch 'master' into finance-portal-service
Dec 17, 2019
d94908e
Merge branch 'master' into finance-portal-service
mdebarros Dec 18, 2019
2dc543b
Update image repository of backend service
Dec 19, 2019
b7e1063
update portal images so the licenses get recognized
Dec 19, 2019
a2a037a
fix centralledger endpoint
Dec 27, 2019
f6e3e59
update latest portal versions and fix sql_mode
Jan 3, 2020
c8860be
fix labels and ingress
Jan 7, 2020
a36bc6c
add portal settlement to lint scripts
Jan 7, 2020
293aa2e
Merge branch 'master' into finance-portal-service
mdebarros Jan 7, 2020
0923be2
change finance-portal-settlement-management name
Jan 7, 2020
464c821
Updated selectors for portal and portal settlement management
partiallyordered Jan 8, 2020
c7affc5
Merge branch 'master' into finance-portal-service
Jan 8, 2020
2da741a
Removed duplicate appVersion
partiallyordered Jan 8, 2020
b96d147
Merge branch 'finance-portal-service' of github.com:mojaloop/helm int…
partiallyordered Jan 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions finance-portal-settlement-management/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description: Portal Settlement
name: finance-portal-settlement-management
version: 8.6.0
appVersion: "8.6.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate appVersion

32 changes: 32 additions & 0 deletions finance-portal-settlement-management/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "finance-portal-settlement-management.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "finance-portal-settlement-management.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "finance-portal-settlement-management.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
19 changes: 19 additions & 0 deletions finance-portal-settlement-management/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "finance-portal-settlement-management.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
ADMIN_ENDPOINT: {{ (printf "%s%s-%s:%s" "http://" .Release.Name .Values.settlementManagement.config.CENTRAL_LEDGER_SERVICE_NAME .Values.settlementManagement.config.CENTRAL_LEDGER_SERVICE_ADMIN_PORT) | quote }}
MIN_WINDOW_AGE_MS: {{ (printf "%s" .Values.settlementManagement.config.MIN_WINDOW_AGE_MS) | quote }}
SETTLEMENT_ENDPOINT: {{ (printf "%s%s-%s:%s/%s" "http://" .Release.Name .Values.settlementManagement.config.SETTLEMENTS_SERVICE_NAME .Values.settlementManagement.config.SETTLEMENTS_SERVICE_PORT "v1") | quote }}
OPERATOR_SETTLEMENT_ENDPOINT: {{ (printf "%s%s-%s:%s" "http://" .Release.Name .Values.settlementManagement.config.OPERATOR_SETTLEMENTS_SERVICE_NAME .Values.settlementManagement.config.OPERATOR_SETTLEMENTS_SERVICE_PORT) | quote }}
DB_USER: {{ .Values.db.user | quote }}
DB_HOST: {{ .Values.db.host | quote }}
DB_PORT: {{ .Values.db.port | quote }}
DB_SCHEMA: {{ .Values.db.schema | quote }}
86 changes: 86 additions & 0 deletions finance-portal-settlement-management/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{{- $dbHost := ( .Values.db.host | replace "$release_name" .Release.Name ) -}}

apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: {{ template "finance-portal-settlement-management.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
initContainers:
{{- if .Values.operatorSettlement.init.enabled }}
- name: operator-settlement-init
image: {{ .Values.operatorSettlement.init.image.repository }}
imagePullPolicy: {{ .Values.operatorSettlement.init.pullPolicy }}
command:
- sh
- "-c"
- {{ (.Values.operatorSettlement.init.command | replace "$db_user" (print .Values.db.user) | replace "$db_password" (print .Values.db.password) | replace "$db_host" $dbHost | replace "$db_database" (print .Values.db.schema) | replace "$db_port" (print .Values.db.port) )| quote }}
{{- end }}
{{- if .Values.settlementManagement.init.enabled }}
- name: settlement-management-init
image: {{ .Values.settlementManagement.init.image.repository }}
imagePullPolicy: {{ .Values.settlementManagement.init.pullPolicy }}
command:
- sh
- "-c"
- {{ (.Values.settlementManagement.init.command | replace "$db_user" (print .Values.db.user) | replace "$db_password" (print .Values.db.password) | replace "$db_host" $dbHost | replace "$db_database" (print .Values.db.schema) | replace "$db_port" (print .Values.db.port) )| quote }}
{{- end }}
containers:
- name: operator-settlement
image: "{{ .Values.operatorSettlement.image.repository }}:{{ .Values.operatorSettlement.image.tag }}"
imagePullPolicy: {{ .Values.operatorSettlement.image.pullPolicy }}
ports:
- name: operator
containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: operator
readinessProbe:
httpGet:
path: /
port: operator
envFrom:
- configMapRef:
name: {{ template "finance-portal-settlement-management.fullname" . }}
- secretRef:
name: {{ template "finance-portal-settlement-management.fullname" . }}
resources:
- name: settlement-management
image: "{{ .Values.settlementManagement.image.repository }}:{{ .Values.settlementManagement.image.tag }}"
imagePullPolicy: {{ .Values.settlementManagement.image.pullPolicy }}
ports:
- name: management
containerPort: 5000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: management
readinessProbe:
httpGet:
path: /
port: management
envFrom:
- configMapRef:
name: {{ template "finance-portal-settlement-management.fullname" . }}
- secretRef:
name: {{ template "finance-portal-settlement-management.fullname" . }}
imagePullSecrets:
- name: {{ .Values.imageCredentials.name }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if .Values.operatorSettlement.ingress.enabled -}}
{{- $serviceName := include "finance-portal-settlement-management.fullname" . -}}
{{- $operatorSettlementPort := .Values.operatorSettlement.service.port -}}
{{- $operatorSettlementPath := .Values.operatorSettlement.ingress.externalPath -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "finance-portal-settlement-management.fullname" . }}-operator-settlement
labels:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
annotations:
{{- range $key, $value := .Values.operatorSettlement.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range $host := .Values.operatorSettlement.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: {{ $operatorSettlementPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $operatorSettlementPort }}
{{- end -}}
{{- if .Values.operatorSettlement.ingress.tls }}
tls:
{{ toYaml .Values.operatorSettlement.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
20 changes: 20 additions & 0 deletions finance-portal-settlement-management/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- $dbHost := (.Values.db.host | replace "$release_name" .Release.Name) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "finance-portal-settlement-management.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
type: Opaque
data:
DB_PROTOCOL: {{ .Values.db.protocol | b64enc }}
DB_USER: {{ .Values.db.user | b64enc }}
DB_PASSWORD: {{ .Values.db.password | b64enc }}
DB_HOST: {{ $dbHost | b64enc }}
DB_PORT: {{ .Values.db.port | b64enc }}
DB_SCHEMA: {{ .Values.db.schema | b64enc }}

24 changes: 24 additions & 0 deletions finance-portal-settlement-management/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "finance-portal-settlement-management.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.operatorSettlement.service.port }}
targetPort: operator
protocol: TCP
name: http-operator-settlement
- port: {{ .Values.settlementManagement.service.port }}
targetPort: management
protocol: TCP
name: http-settlement-management
selector:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if .Values.settlementManagement.ingress.enabled -}}
{{- $serviceName := include "finance-portal-settlement-management.fullname" . -}}
{{- $settlementManagementPort := .Values.settlementManagement.service.port -}}
{{- $settlementManagementPath := .Values.settlementManagement.ingress.externalPath -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "finance-portal-settlement-management.fullname" . }}-settlement-management
labels:
app.kubernetes.io/name: {{ include "finance-portal-settlement-management.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
annotations:
{{- range $key, $value := .Values.settlementManagement.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range $host := .Values.settlementManagement.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: {{ $settlementManagementPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $settlementManagementPort }}
{{- end -}}
{{- if .Values.settlementManagement.ingress.tls }}
tls:
{{ toYaml .Values.settlementManagement.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
87 changes: 87 additions & 0 deletions finance-portal-settlement-management/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
# Default values shared by all containers
db:
protocol: 'mysql'
host: '$release_name-centralledger-mysql'
port: '3306'
user: 'central_ledger'
password: 'oyMxgZChuu'
schema: 'central_ledger'

service:
type: ClusterIP

imageCredentials:
name: pull-secrets

# Default values for operator-settlement
operatorSettlement:
image:
repository: mojaloop/operator-settlement
tag: latest
pullPolicy: Always

service:
port: 80

init:
enabled: true
image:
repository: mojaloop/operator-settlement
tag: latest
pullPolicy: Always
command: mysql -h $db_host -P $db_port -u $db_user --password=$db_password $db_database < /opt/operator-settlement/init.sql

ingress:
enabled: true
externalPath: /
hosts:
api: operator-settlement.local
annotations:
nginx.ingress.kubernetes.io/rewrite-target: '/'
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
tls:

# Default values for settlement-management
settlementManagement:
image:
repository: mojaloop/settlement-management
tag: latest
pullPolicy: Always

service:
port: 5000

init:
enabled: true
image:
repository: mojaloop/settlement-management
tag: latest
pullPolicy: Always
command: mysql -h $db_host -P $db_port -u $db_user --password=$db_password $db_database < /opt/settlement-management/init.sql

config:
CENTRAL_LEDGER_SERVICE_NAME: 'centralledger-service'
CENTRAL_LEDGER_SERVICE_ADMIN_PORT: '3001'
SETTLEMENTS_SERVICE_NAME: 'centralsettlement'
SETTLEMENTS_SERVICE_PORT: '80'
MIN_WINDOW_AGE_MS: '5000'
OPERATOR_SETTLEMENTS_SERVICE_NAME: 'settlement'
OPERATOR_SETTLEMENTS_SERVICE_PORT: '80'

ingress:
enabled: true
externalPath: /
hosts:
api: settlement-management.local
annotations:
nginx.ingress.kubernetes.io/rewrite-target: '/'
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
tls:
# Secrets must be manually created in the namespace.
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
6 changes: 6 additions & 0 deletions finance-portal/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
appVersion: "1.0"
description: Finance portal service
name: finance-portal
version: 8.6.0
appVersion: "8.6.0"
32 changes: 32 additions & 0 deletions finance-portal/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "finance-portal.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "finance-portal.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "finance-portal.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Loading