Skip to content

Commit

Permalink
More fixes for TRS and sidecar
Browse files Browse the repository at this point in the history
  • Loading branch information
oderayi committed Mar 20, 2020
1 parent 9d96ba3 commit 06c6292
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 17 deletions.
6 changes: 3 additions & 3 deletions mojaloop/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3391,7 +3391,7 @@ transaction-requests-service:
replicaCount: 1
image:
repository: mojaloop/transaction-requests-service
tag: v9.3.0
tag: v9.4.0
pullPolicy: Always

readinessProbe:
Expand Down Expand Up @@ -3466,7 +3466,7 @@ transaction-requests-service:
api:
name: http-api
externalPort: 80
internalPort: 4001
internalPort: 4000

annotations: {}

Expand All @@ -3481,7 +3481,7 @@ transaction-requests-service:
ports:
api:
name: http-api
externalPort: 4001
externalPort: 4000

ingress:
enabled: true
Expand Down
50 changes: 50 additions & 0 deletions transaction-requests-service/configs/default-sidecar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{{- $kafkaHost := ( .Values.config.kafka_host | replace "$release_name" .Release.Name ) -}}
{
"PORT": {{ .Values.sidecar.service.internalPort }},
"EVENT_LOGGER_GRPC_HOST": "{{ .Values.sidecar.config.event_log_grpc_host }}",
"EVENT_LOGGER_GRPC_PORT": {{ .Values.sidecar.config.event_log_grpc_port }},
"INSTRUMENTATION": {
"METRICS": {
"DISABLED": false,
"labels": {
"eventId": "*"
},
"config": {
"timeout": 5000,
"prefix": "moja_",
"defaultLabels": {
"serviceName": "{{ template "transaction-requests-service.name" . }}-event-sidecar"
}
}
}
},
"KAFKA": {
"TOPIC_TEMPLATES": {
"GENERAL_TOPIC_TEMPLATE": {
"TEMPLATE": "topic-{{"{{"}}functionality{{"}}"}}",
"REGEX": "topic-(.*)"
}
},
"PRODUCER": {
"EVENT": {
"config": {
"options": {
"messageCharset": "utf8"
},
"rdkafkaConf": {
"metadata.broker.list": "{{ $kafkaHost }}:{{ .Values.config.kafka_port }}",
"client.id": "es-prod-event",
"event_cb": true,
"dr_cb": true,
"socket.keepalive.enable": true,
"queue.buffering.max.messages": 10000000
},
"topicConf": {
"request.required.acks": "all",
"partitioner": "{{ .Values.config.kafka_partitioner }}"
}
}
}
}
}
}
17 changes: 16 additions & 1 deletion transaction-requests-service/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,19 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
default.json: {{ (tpl (.Files.Get "configs/default.json") . ) | quote }}
default.json: {{ (tpl (.Files.Get "configs/default.json") . ) | quote }}
{{- if .Values.sidecar.enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "transaction-requests-service.fullname" . }}-sidecar
labels:
app.kubernetes.io/name: {{ include "transaction-requests-service.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:
default.json: {{ (tpl (.Files.Get "configs/default-sidecar.json") . ) | quote }}
{{- end }}
24 changes: 12 additions & 12 deletions transaction-requests-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ spec:
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
spec:
{{- if .Values.global.config.affinity }}
{{- if .Values.global.config.affinity }}
affinity:
{{ toYaml .Values.global.config.affinity | indent 8 }}
{{- end }}
{{- if .Values.global.config.nodeSelector }}
{{ toYaml .Values.global.config.affinity | indent 8 }}
{{- end }}
{{- if .Values.global.config.nodeSelector }}
nodeSelector:
{{ toYaml .Values.global.config.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.global.config.tolerations }}
{{ toYaml .Values.global.config.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.global.config.tolerations }}
tolerations:
{{ toYaml .Values.global.config.tolerations | indent 8 }}
{{- end }}
{{- if .Values.init.enabled }}
{{ toYaml .Values.global.config.tolerations | indent 8 }}
{{- end }}
{{- if .Values.init.enabled }}
initContainers: []
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
- name: {{ template "transaction-requests-service.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
Expand Down
8 changes: 7 additions & 1 deletion transaction-requests-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ global:
replicaCount: 1
image:
repository: mojaloop/transaction-requests-service
tag: v9.3.0
tag: v9.4.0
pullPolicy: Always

readinessProbe:
Expand Down Expand Up @@ -87,6 +87,12 @@ config:
include_cause_extension: false
truncate_extensions: true

## Kafka Configuration
# this can be set if the dependency chart for kafka is disabled. If 'kafka_host' is commented out, then the name of the dependency chart will be used.
kafka_host: '$release_name-kafka'
kafka_port: 9092
kafka_partitioner: 'murmur2_random'

init:
enabled: false

Expand Down

0 comments on commit 06c6292

Please sign in to comment.