Skip to content

Commit

Permalink
Merge pull request #35 from pm4ml/feat/enable-sdk-bulk
Browse files Browse the repository at this point in the history
feat(mojaloop/3108): enable sdk bulk
  • Loading branch information
vijayg10 authored Feb 28, 2023
2 parents 65c0a23 + 9f8f06b commit 98800f2
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 9 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ whitelist_ip_file?=
extra_tag_file?=
vpn_client_ip_file?=
grafana_internal_access_only?=yes
ttk_enabled?=no
ttk_payee_simulator_enabled?=no
pm4ml_kafka_helm_version?=15.2.1
redis_replica_count?=1
##
# Configuration variables
##
Expand Down Expand Up @@ -383,6 +383,8 @@ config: .env ## Run first-time configuration
pm4ml_client_cert_remote_dir=$$(readConfigVar "PM4ML Remote Cert Dir" "pm4ml_client_cert_remote_dir" "$(pm4ml_client_cert_remote_dir)")
pm4ml_client_cert_local_dir=$$(readConfigVar "PM4ML Local Cert Dir" "pm4ml_client_cert_local_dir" "$(pm4ml_client_cert_local_dir)")
pm4ml_helm_version=$$(readConfigVar "PM4ML Chart Version" "pm4ml_helm_version" "$(pm4ml_helm_version)")
pm4ml_kafka_helm_version=$$(readConfigVar "PM4ML Kafka Chart Version" "pm4ml_kafka_helm_version" "$(pm4ml_kafka_helm_version)")
redis_replica_count=$$(readConfigVar "PM4ML Kafka Chart Version" "redis_replica_count" "$(redis_replica_count)")
pm4ml_dfsp_internal_access_only=$$(readConfigVar "PM4ML Endpoint Access" "pm4ml_dfsp_internal_access_only" "$(pm4ml_dfsp_internal_access_only)")
internal_pm4ml_instance=$$(readConfigVar "expose outbound connector ingress" "internal_pm4ml_instance" "$(internal_pm4ml_instance)")
fi
Expand Down
2 changes: 0 additions & 2 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ all:
internal_managed_privkey_file: '{{ internal_managed_privkey_file }}'
mojaloop_switch_extgw_port: '{{ ext_gw_listen_port }}'
grafana_internal_access_only: '{{ grafana_internal_access_only }}'
ttk_enabled: '{{ ttk_enabled }}'
ttk_payee_simulator_enabled: '{{ ttk_payee_simulator_enabled }}'
# --------------
bastion:
vars:
Expand Down
24 changes: 24 additions & 0 deletions ansible/pm4ml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,30 @@
- pm4ml
when: internal_managed_tls == 'no'

- name: Upload helm values of kafka
template:
src: "templates/kafka.values.yml.j2"
dest: "{{ tmpvalues.path }}/{{ item.key }}.kafka.values.yml"
loop: "{{ pm4ml | dict2items }}"
loop_control:
label: "{{ item.key }}"
tags:
- kafka
when: item.value.enable_sdk_bulk_transaction_support == 'yes'

- name: Deploy kafka helm chart
shell: |
helm repo add kafka_bitnami https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
helm repo update
# sed -i "s/##KEYCLOAK_PASSWORD##/${KEYCLOAKPW}/g" {{ tmpvalues.path }}/{{ item.key }}.kafka.values.yml
helm upgrade --create-namespace --namespace {{ item.key }} --install kafka kafka_bitnami/kafka --version {{ pm4ml_kafka_helm_version }} -f "{{ tmpvalues.path }}/{{ item.key }}.kafka.values.yml"
loop: "{{ pm4ml | dict2items }}"
loop_control:
label: "{{ item.key }}"
tags:
- kafka
when: item.value.enable_sdk_bulk_transaction_support == 'yes'

- name: Deploy pm4ml helm chart
shell: |
helm repo add pm https://pm4ml.github.io/mojaloop-payment-manager-helm/repo
Expand Down
111 changes: 111 additions & 0 deletions ansible/templates/kafka.values.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
## Installation
# https://bitnami.com/stack/kafka/helm
# https://github.com/bitnami/charts/blob/master/bitnami/kafka
# helm repo add bitnami https://charts.bitnami.com/bitnami
# helm install kafka bitnami/kafka -f ./bitnami-kafka-charts.IGNORE.yaml

## @section Global parameters
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass

## @param global.imageRegistry Global Docker image registry
## @param global.imagePullSecrets Global Docker registry secret names as an array
## @param global.storageClass Global StorageClass for Persistent Volume(s)
##
global:
storageClass: {{ storage_class_name }}

## @section Common parameters

## fullnameOverride: kafka



## @param listeners The address(es) the socket server listens on. Auto-calculated it's set to an empty array
## When it's set to an empty array, the listeners will be configured
## based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters)
##
listeners: []
## @param advertisedListeners The address(es) (hostname:port) the broker will advertise to producers and consumers. Auto-calculated it's set to an empty array
## When it's set to an empty array, the advertised listeners will be configured
## based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters)
##
advertisedListeners: []

service:
ports:
client: 9092

## Persistence parameters
##
persistence:
## @param persistence.enabled Enable Kafka data persistence using PVC, note that Zookeeper persistence is unaffected
##
enabled: false
## @param persistence.existingClaim Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template
## If defined, PVC must be created manually before volume will be bound
## The value is evaluated as a template
##
existingClaim: ""
## @param persistence.storageClass PVC Storage Class for Kafka data volume
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner.
##
storageClass: {{ storage_class_name }}
## @param persistence.accessModes PV Access Mode
##
accessModes:
- ReadWriteOnce
## @param persistence.size PVC Storage Request for Kafka data volume
##
size: 5Gi
## @param persistence.annotations Annotations for the PVC
##
annotations: {}
## @param persistence.selector Selector to match an existing Persistent Volume for Kafka's data PVC. If set, the PVC can't have a PV dynamically provisioned for it
## selector:
## matchLabels:
## app: my-app
selector: {}
## @param persistence.mountPath Mount path of the Kafka data volume
##
mountPath: /bitnami/kafka

## @section Zookeeper chart parameters

## Zookeeper chart configuration
## https://github.com/bitnami/charts/blob/master/bitnami/zookeeper/values.yaml
##
zookeeper:
## @param zookeeper.enabled Switch to enable or disable the Zookeeper helm chart
##
enabled: true
persistence:
## @param persistence.existingClaim Provide an existing `PersistentVolumeClaim`
## If defined, PVC must be created manually before volume will be bound
## The value is evaluated as a template
##
existingClaim: ""
## @param persistence.enabled Enable Zookeeper data persistence using PVC
##
enabled: false
auth:
## @param zookeeper.auth.enabled Enable Zookeeper auth
##
enabled: false
## @param zookeeper.auth.clientUser User that will use Zookeeper clients to auth
##
clientUser: ""
## @param zookeeper.auth.clientPassword Password that will use Zookeeper clients to auth
##
clientPassword: ""
## @param zookeeper.auth.serverUsers Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin"
##
serverUsers: ""
## @param zookeeper.auth.serverPasswords Comma, semicolon or whitespace separated list of passwords to assign to users when created. Specify them as a string, for example: "pass4user1, pass4user2, pass4admin"
##
serverPasswords: ""

41 changes: 38 additions & 3 deletions ansible/templates/pm4ml.values.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,21 @@ mojaloop-core-connector:

scheme-adapter:
sdk-scheme-adapter-api-svc:
redis:
{% if item.value.enable_sdk_bulk_transaction_support == "yes" %}
kafka: &kafkaConfig
host: kafka
port: 9092
{% endif %}
redis: &redisConfig
host: redis-master
port: 6379
config:
simName: *dfspId
{% if item.value.enable_sdk_bulk_transaction_support == "yes" %}
bulkTransactionSupportEnabled: true
{% else %}
bulkTransactionSupportEnabled: false
{% endif %}
## TODO: sdk chart is not accepting empty jws values if JWS params enabled. Need to fix.
jwsSigningKey: "test"
jwsVerificationKeys: {
Expand All @@ -178,6 +188,11 @@ scheme-adapter:
BACKEND_ENDPOINT: "{{ item.value.helm_release_name }}-mojaloop-core-connector:3003"
{% endif %}
MGMT_API_WS_URL: "{{ item.value.helm_release_name }}-management-api"
{% if item.value.enable_sdk_bulk_transaction_support == "yes" %}
ENABLE_BACKEND_EVENT_HANDLER: true
ENABLE_FSPIOP_EVENT_HANDLER: true
REQUEST_PROCESSING_TIMEOUT_SECONDS: 30
{% endif %}
ingress:
enabled: true
annotations:
Expand All @@ -193,7 +208,25 @@ scheme-adapter:
- "connector.{{ item.key }}.{{ item.value.pm4ml_subdomain }}"
secretName: mojaloop-connector-tls

{% if item.value.enable_sdk_bulk_transaction_support == "yes" %}
sdk-scheme-adapter-dom-evt-handler:
enabled: true
kafka: *kafkaConfig
redis: *redisConfig
config:
simName: *dfspId

sdk-scheme-adapter-cmd-evt-handler:
enabled: true
kafka: *kafkaConfig
redis: *redisConfig
config:
simName: *dfspId
{% endif %}

redis:
replica:
replicaCount: {{ redis_replica_count }}
auth:
enabled: false
sentinel: false
Expand All @@ -217,8 +250,9 @@ ttk:
host: ttk-specapi.{{ item.key }}.{{ item.value.pm4ml_subdomain }}
adminApi:
host: ttk.{{ item.key }}.{{ item.value.pm4ml_subdomain }}
className: {{ pm4ml_ingress_classname }}
className: null
annotations:
kubernetes.io/ingress.class: {{ pm4ml_ingress_classname }}
external-dns.alpha.kubernetes.io/target: {{ dfsp_access_lb_hostname }}
# Not enabling tls ingress endpoints because there is some issue in the TTK helm chart and its not accepting tls ingress configuration.
# Need to fix it in TTK helm chart and then only we can enable tls here
Expand All @@ -239,8 +273,9 @@ ttk:
hosts:
ui:
host: ttk.{{ item.key }}.{{ item.value.pm4ml_subdomain }}
className: {{ pm4ml_ingress_classname }}
className: null
annotations:
kubernetes.io/ingress.class: {{ pm4ml_ingress_classname }}
external-dns.alpha.kubernetes.io/target: {{ dfsp_access_lb_hostname }}
# Not enabling tls ingress endpoints because there is some issue in the TTK helm chart and its not accepting tls ingress configuration.
# Need to fix it in TTK helm chart and then only we can enable tls here
Expand Down
4 changes: 2 additions & 2 deletions samplefiles/.env
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ ext_gw_listen_port=443
use_aws_acm_cert=false
aws_acm_wildcard_entry=pm4mlname
grafana_internal_access_only=yes
ttk_enabled=no
ttk_payee_simulator_enabled=no
pm4ml_kafka_helm_version=15.2.1
redis_replica_count=1
az_count=1

0 comments on commit 98800f2

Please sign in to comment.