Skip to content

Commit

Permalink
[GOV-83] Enable closed loop (#308)
Browse files Browse the repository at this point in the history
* Connector chart

* Bug fix

* Indentation fix

* addressing review comments

* Bug fix

* fix

* disable connector in phee-engine

* Adding variables

* Variable name change
  • Loading branch information
apurbraj authored Dec 30, 2023
1 parent 65966bf commit 639492e
Show file tree
Hide file tree
Showing 19 changed files with 248 additions and 221 deletions.
22 changes: 22 additions & 0 deletions helm/g2p-sandbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,26 @@ ph-ee-engine:
annotations:
deployTime: "{{ .Values.deployTime }}"

connector:
enabled: true
image: docker.io/openmf/ph-ee-connector-bulk:latest
aws:
region: "ap-south-1"
access_key: "aws-access-key"
secret_key: "aws-secret-key"
hostname: "connector.sandbox.mifos.io"
ingress:
enabled: true
annotations:
nginx.ingress.kubernetes.io/access-control-allow-origin: 'true'
nginx.ingress.kubernetes.io/cors-allow-methods: PUT, GET, POST, OPTIONS, DELETE
nginx.ingress.kubernetes.io/cors-allow-origin: '*'
nginx.ingress.kubernetes.io/enable-cors: 'true'

deployment:
annotations:
deployTime: "{{ .Values.deployTime }}"

account_mapper:
enabled: true
image: docker.io/openmf/ph-ee-identity-account-mapper:v1.4.0
Expand Down Expand Up @@ -614,3 +634,5 @@ account_mapper:
username: mifos
password: password



Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ spec:
value: "{{ .Release.Name }}-zeebe-gateway:26500"
- name: "DFSPIDS"
value: "{{ .Values.DFSPIDS }}"
- name: "CONNECTOR_CONTACTPOINT"
value: "{{ .Values.connector.contactpoint }}"
- name: "BILLPAY_CONTACTPOINT"
value: "{{ .Values.billpay.contactpoint }}"
{{- if .Values.extraEnvs | default .Values.deployment.extraEnvs }}
{{ toYaml ( .Values.extraEnvs | default .Values.deployment.extraEnvs ) | indent 10 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions helm/ph-ee-engine/connector-bill-pay/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ imageTag: latest
imagePullPolicy: "Always"
SPRING_PROFILES_ACTIVE: "bb,tenants"
LOGGING_LEVEL_ROOT: "INFO"
billpay:
contactpoint: ""
connector:
contactpoint: ""
DFSPIDS: ""
limits:
cpu: "500m"
Expand Down
5 changes: 0 additions & 5 deletions helm/ph-ee-engine/connector-bulk-closedloop/Chart.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions helm/ph-ee-engine/connector-bulk-closedloop/templates/ingress.yaml

This file was deleted.

73 changes: 0 additions & 73 deletions helm/ph-ee-engine/connector-bulk-closedloop/values.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion helm/ph-ee-engine/connector-bulk/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ aws:
access_key: "<access key>"
secret_key: "<secret key>"
limits:
cpu: "500m"
cpu: "256m"
memory: "512M"
requests:
cpu: "100m"
Expand Down
5 changes: 5 additions & 0 deletions helm/ph-ee-engine/connector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
description: ph-ee-connector
name: connector
version: 1.0.0
appVersion: "1.0.0"
11 changes: 11 additions & 0 deletions helm/ph-ee-engine/connector/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.managedServiceAccount }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
# "namespace" omitted since ClusterRoles are not namespaced
name: ph-ee-connector-c-role
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "watch", "list"]
{{- end -}}
15 changes: 15 additions & 0 deletions helm/ph-ee-engine/connector/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.managedServiceAccount }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ph-ee-connector-c-role-binding
subjects:
- kind: ServiceAccount
name: ph-ee-connector # name of your service account
namespace: paymenthub # this is the namespace your service account is in
roleRef: # referring to your ClusterRole
kind: ClusterRole
name: ph-ee-connector-c-role
apiGroup: rbac.authorization.k8s.io

{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ph-ee-connector-bulk-closedloop
name: ph-ee-connector
labels:
app: ph-ee-connector-bulk-closedloop
app: ph-ee-connector
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: ph-ee-connector-bulk-closedloop
app: ph-ee-connector
template:
metadata:
labels:
app: ph-ee-connector-bulk-closedloop
app: ph-ee-connector
annotations:
{{- if .Values.deployment.annotations }}
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
containers:
- name: ph-ee-connector-bulk-closedloop
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: "{{ .Values.global.imagePullPolicy }}"
- name: ph-ee-connector
image: "{{ .Values.image }}"
ports:
- containerPort: 5000
- containerPort: 8080
imagePullPolicy: "{{ .Values.global.imagePullPolicy }}"
resources:
limits:
memory: "{{ .Values.limits.memory }}"
cpu: "{{ .Values.limits.cpu }}"
requests:
memory: "{{ .Values.requests.memory }}"
cpu: "{{ .Values.requests.cpu }}"

env:
- name: "SPRING_PROFILES_ACTIVE"
value: "{{ .Values.global.SPRING_PROFILES_ACTIVE }}"
- name: "CAMEL_DISABLE-SSL"
value: "{{ .Values.camel_disable_ssl }}"
- name: "ZEEBE_BROKER_CONTACTPOINT"
value: "{{ .Release.Name }}-zeebe-gateway:26500"
- name: "TENANTS"
value: "{{ .Values.tenants }}"
- name: "APPLICATION_BUCKET-NAME"
value: "{{ .Values.application.bucket_name }}"
- name: "OPERATIONS-APP_CONTACTPOINT"
value: "{{ .Values.operations_app.contactpoint }}"
- name: "OPERATIONS-APP_ENDPOINTS_BATCH-SUMMARY"
value: "{{ .Values.operations_app.endpoints.batch-summary }}"
value: "{{ .Values.operations_app.endpoints.batch_summary }}"
- name: "OPERATIONS-APP_ENDPOINTS_BATCH-DETAIL"
value: "{{ .Values.operations_app.endpoints.batch-detail }}"
value: "{{ .Values.operations_app.endpoints.batch_detail }}"
- name: "MOCK-PAYMENT-SCHEMA_CONTACTPOINT"
value: "{{ .Values.mock-payment-schema.contactpoint }}"
value: "{{ .Values.mock_payment_schema.contactpoint }}"
- name: "MOCK-PAYMENT-SCHEMA_ENDPOINTS_BATCH-SUMMARY"
value: "{{ .Values.mock-payment-schema.endpoints.batch-summary }}"
value: "{{ .Values.mock_payment_schema.endpoints.batch_summary }}"
- name: "MOCK-PAYMENT-SCHEMA_ENDPOINTS_BATCH-DETAIL"
value: "{{ .Values.mock-payment-schema.endpoints.batch-detail }}"
value: "{{ .Values.mock_payment_schema.endpoints.batch_detail }}"
- name: "BULK-PROCESSOR_CONTACTPOINT"
value: "{{ .Values.bulk-processor.contactpoint }}"
value: "{{ .Values.bulk_processor.contactpoint }}"
- name: "BULK-PROCESSOR_ENDPOINTS_BATCH-TRANSACTION"
value: "{{ .Values.bulk-processor.endpoints.batch-transaction }}"
- name: "CONFIG_COMPLETION-THRESHOLD-CHECK_COMPLETION-THRESHOLD"
value: "{{ .Values.config.completion_threshold_check.completion-threshold }}"
- name: "CONFIG_COMPLETION-THRESHOLD-CHECK_MAX-RETRY-COUNT"
value: "{{ .Values.config.completion_threshold_check.max-retry-count }}"
- name: "CONFIG_COMPLETION-THRESHOLD-CHECK_WAIT-TIMER"
value: "{{ .Values.config.completion_threshold_check.wait-timer }}"
value: "{{ .Values.bulk_processor.endpoints.batch_transaction }}"
- name: "TENANT"
value: "{{ .Values.global.tenant }}"
- name: "CLOUD_AWS_REGION_STATIC"
Expand All @@ -80,6 +73,12 @@ spec:
secretKeyRef:
name: "bulk-processor-secret"
key: "aws-secret-key"

{{- if .Values.extraEnvs | default .Values.deployment.extraEnvs }}
{{ toYaml ( .Values.extraEnvs | default .Values.deployment.extraEnvs ) | indent 10 }}
{{- end }}
envFrom: {{ toYaml ( .Values.envFrom | default .Values.deployment.envFrom ) | nindent 12 }}
securityContext: {{ toYaml ( .Values.podSecurityContext | default .Values.deployment.securityContext ) | nindent 12 }}
volumeMounts:
- name: ph-ee-config
mountPath: "/config"
Expand Down
49 changes: 49 additions & 0 deletions helm/ph-ee-engine/connector/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{{- if .Values.ingress.enabled -}}
{{- $pathtype := .Values.ingress.pathtype -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ph-ee-connector
labels:
app: {{ .Chart.Name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className | quote }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- if .ingressPath }}
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- else }}
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end }}
{{- end}}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ $pathtype }}
backend:
service:
name: {{ .backend.service.name}}
port:
number: {{ .backend.service.port.number}}
{{- end }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions helm/ph-ee-engine/connector/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.managedServiceAccount }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ph-ee-operator-role-binding
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ph-ee-operator-role
subjects:
- kind: ServiceAccount
name: payment-hub
namespace: {{ .Release.Namespace }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{- if .Values.enabled -}}
apiVersion: {{ .Values.secret.apiversion }}
kind: Secret
metadata:
name: bulk-closedloop-secret
type: Opaque
data:
aws-access-key: {{ .Values.aws.access_key | b64enc }}
aws-secret-key: {{ .Values.aws.secret_key | b64enc }}
aws-secret-key: {{ .Values.aws.secret_key | b64enc }}
{{- end }}
Loading

0 comments on commit 639492e

Please sign in to comment.