-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat(midaz): add unified ledger config (CRM/Fees/KMS/tracer) and tracer templates #1838
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
Changes from 2 commits
bed01b2
cb93090
25a3d76
0c3d853
d722d48
368e90c
cd62b43
5a56a60
aa8e181
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,7 @@ data: | |
| MULTI_TENANT_SERVICE_NAME: {{ .Values.ledger.configmap.MULTI_TENANT_SERVICE_NAME | default "ledger" | quote }} | ||
| MULTI_TENANT_CIRCUIT_BREAKER_THRESHOLD: {{ .Values.ledger.configmap.MULTI_TENANT_CIRCUIT_BREAKER_THRESHOLD | default "5" | quote }} | ||
| MULTI_TENANT_CIRCUIT_BREAKER_TIMEOUT_SEC: {{ .Values.ledger.configmap.MULTI_TENANT_CIRCUIT_BREAKER_TIMEOUT_SEC | default "30" | quote }} | ||
| MULTI_TENANT_CACHE_TTL_SEC: {{ .Values.ledger.configmap.MULTI_TENANT_CACHE_TTL_SEC | default "120" | quote }} | ||
| MULTI_TENANT_REDIS_HOST: {{ required "ledger.configmap.MULTI_TENANT_REDIS_HOST is required when MULTI_TENANT_ENABLED=true" .Values.ledger.configmap.MULTI_TENANT_REDIS_HOST | quote }} | ||
| MULTI_TENANT_REDIS_PORT: {{ .Values.ledger.configmap.MULTI_TENANT_REDIS_PORT | default "6379" | quote }} | ||
| MULTI_TENANT_REDIS_TLS: {{ .Values.ledger.configmap.MULTI_TENANT_REDIS_TLS | default "false" | quote }} | ||
|
|
@@ -128,6 +129,60 @@ data: | |
| MONGO_TRANSACTION_PARAMETERS: {{ .Values.ledger.configmap.MONGO_TRANSACTION_PARAMETERS | default "" | quote }} | ||
| MONGO_TRANSACTION_TLS_CA_CERT: {{ .Values.ledger.configmap.MONGO_TRANSACTION_TLS_CA_CERT | default "" | quote }} | ||
|
|
||
| # ============================================================================= | ||
| # MONGO DB - CRM MODULE (folded into the unified ledger binary) | ||
| # ============================================================================= | ||
| MONGO_CRM_URI: {{ .Values.ledger.configmap.MONGO_CRM_URI | default "mongodb" | quote }} | ||
| MONGO_CRM_HOST: {{ .Values.ledger.configmap.MONGO_CRM_HOST | default "midaz-mongodb" | quote }} | ||
| MONGO_CRM_NAME: {{ .Values.ledger.configmap.MONGO_CRM_NAME | default "crm" | quote }} | ||
| MONGO_CRM_USER: {{ .Values.ledger.configmap.MONGO_CRM_USER | default "midaz" | quote }} | ||
| MONGO_CRM_PORT: {{ .Values.ledger.configmap.MONGO_CRM_PORT | default "27017" | quote }} | ||
| # MONGO_CRM_PASSWORD lives in the ledger Secret (see templates/ledger/secrets.yaml) | ||
| MONGO_CRM_MAX_POOL_SIZE: {{ .Values.ledger.configmap.MONGO_CRM_MAX_POOL_SIZE | default "1000" | quote }} | ||
| MONGO_CRM_PARAMETERS: {{ .Values.ledger.configmap.MONGO_CRM_PARAMETERS | default "" | quote }} | ||
| MONGO_CRM_TLS_CA_CERT: {{ .Values.ledger.configmap.MONGO_CRM_TLS_CA_CERT | default "" | quote }} | ||
|
|
||
| # ============================================================================= | ||
| # MONGO DB - FEES MODULE (folded into the unified ledger binary) | ||
| # ============================================================================= | ||
| MONGO_FEES_URI: {{ .Values.ledger.configmap.MONGO_FEES_URI | default "mongodb" | quote }} | ||
| MONGO_FEES_HOST: {{ .Values.ledger.configmap.MONGO_FEES_HOST | default "midaz-mongodb" | quote }} | ||
| MONGO_FEES_NAME: {{ .Values.ledger.configmap.MONGO_FEES_NAME | default "fees" | quote }} | ||
| MONGO_FEES_USER: {{ .Values.ledger.configmap.MONGO_FEES_USER | default "midaz" | quote }} | ||
| MONGO_FEES_PORT: {{ .Values.ledger.configmap.MONGO_FEES_PORT | default "27017" | quote }} | ||
| # MONGO_FEES_PASSWORD lives in the ledger Secret (see templates/ledger/secrets.yaml) | ||
| MONGO_FEES_MAX_POOL_SIZE: {{ .Values.ledger.configmap.MONGO_FEES_MAX_POOL_SIZE | default "100" | quote }} | ||
| MONGO_FEES_PARAMETERS: {{ .Values.ledger.configmap.MONGO_FEES_PARAMETERS | default "" | quote }} | ||
| MONGO_FEES_TLS_CA_CERT: {{ .Values.ledger.configmap.MONGO_FEES_TLS_CA_CERT | default "" | quote }} | ||
|
|
||
| # ============================================================================= | ||
| # LCRYPTO — key material lives in the ledger Secret, never here. | ||
| # LCRYPTO_HASH_SECRET_KEY and LCRYPTO_ENCRYPT_SECRET_KEY protect CRM holder | ||
| # fields (PII); see templates/ledger/secrets.yaml. | ||
| # ============================================================================= | ||
|
|
||
| # ============================================================================= | ||
| # KMS (encryption vendor selector; see midaz pkg/crypto/resolver.go) | ||
| # KMS_VAULT_SECRET_ID is the AppRole credential and lives in the Secret. | ||
| # ============================================================================= | ||
| KMS_VENDOR: {{ .Values.ledger.configmap.KMS_VENDOR | default "none" | quote }} | ||
| # Vault fields required only when KMS_VENDOR=hashicorp-vault (envelope encryption) | ||
| KMS_VAULT_ADDR: {{ .Values.ledger.configmap.KMS_VAULT_ADDR | default "" | quote }} | ||
| KMS_VAULT_ROLE_ID: {{ .Values.ledger.configmap.KMS_VAULT_ROLE_ID | default "" | quote }} | ||
| KMS_VAULT_AUTH_METHOD: {{ .Values.ledger.configmap.KMS_VAULT_AUTH_METHOD | default "" | quote }} | ||
|
|
||
| # ============================================================================= | ||
| # TRACER RESERVATION SEAM (ledger -> tracer client side) | ||
| # TRACER_BASE_URL empty disables the integration (nil reserver). | ||
| # ============================================================================= | ||
| TRACER_BASE_URL: {{ .Values.ledger.configmap.TRACER_BASE_URL | default "" | quote }} | ||
| TRACER_TRANSPORT: {{ .Values.ledger.configmap.TRACER_TRANSPORT | default "grpc" | quote }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Do not default this integration to a transport that the bundled Tracer does not expose. With |
||
| TRACER_TLS_MODE: {{ .Values.ledger.configmap.TRACER_TLS_MODE | default "" | quote }} | ||
| TRACER_TIMEOUT_MS: {{ .Values.ledger.configmap.TRACER_TIMEOUT_MS | default "" | quote }} | ||
| TRACER_TLS_CERT_FILE: {{ .Values.ledger.configmap.TRACER_TLS_CERT_FILE | default "" | quote }} | ||
| TRACER_TLS_KEY_FILE: {{ .Values.ledger.configmap.TRACER_TLS_KEY_FILE | default "" | quote }} | ||
| TRACER_TLS_CA_FILE: {{ .Values.ledger.configmap.TRACER_TLS_CA_FILE | default "" | quote }} | ||
|
|
||
| # ============================================================================= | ||
| # REDIS (shared between modules) | ||
| # ============================================================================= | ||
|
|
@@ -268,6 +323,26 @@ data: | |
| SD_WATCH_WAIT_TIME: {{ .Values.ledger.configmap.SD_WATCH_WAIT_TIME | default "" | quote }} | ||
| SD_WORKLOAD: {{ .Values.ledger.configmap.SD_WORKLOAD | default "" | quote }} | ||
| STREAMING_ENABLED: {{ .Values.ledger.configmap.STREAMING_ENABLED | default "false" | quote }} | ||
|
|
||
| # ============================================================================= | ||
| # STREAMING (lib-streaming producer; disabled by default) | ||
| # ============================================================================= | ||
| STREAMING_BROKERS: {{ .Values.ledger.configmap.STREAMING_BROKERS | default "" | quote }} | ||
| STREAMING_CLIENT_ID: {{ .Values.ledger.configmap.STREAMING_CLIENT_ID | default "" | quote }} | ||
| STREAMING_CLOUDEVENTS_SOURCE: {{ .Values.ledger.configmap.STREAMING_CLOUDEVENTS_SOURCE | default "" | quote }} | ||
| STREAMING_COMPRESSION: {{ .Values.ledger.configmap.STREAMING_COMPRESSION | default "" | quote }} | ||
| STREAMING_REQUIRED_ACKS: {{ .Values.ledger.configmap.STREAMING_REQUIRED_ACKS | default "" | quote }} | ||
| STREAMING_BATCH_LINGER_MS: {{ .Values.ledger.configmap.STREAMING_BATCH_LINGER_MS | default "" | quote }} | ||
|
|
||
| # ============================================================================= | ||
| # FEE ENGINE | ||
| # ============================================================================= | ||
| DEFAULT_CURRENCY: {{ .Values.ledger.configmap.DEFAULT_CURRENCY | default "USD" | quote }} | ||
|
|
||
| # ============================================================================= | ||
| # CASDOOR | ||
| # ============================================================================= | ||
| CASDOOR_JWK_ADDRESS: {{ .Values.ledger.configmap.CASDOOR_JWK_ADDRESS | default "" | quote }} | ||
| SWAGGER_VERSION: {{ .Values.ledger.configmap.SWAGGER_VERSION | default "${VERSION}" | quote }} | ||
| # Extra Env Vars | ||
| {{- with .Values.ledger.extraEnvVars }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| {{- if .Values.tracer.enabled }} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "midaz-tracer.fullname" . }} | ||
| labels: | ||
| {{- include "midaz-tracer.labels" (dict "context" . "name" .Values.tracer.name ) | nindent 4 }} | ||
| data: | ||
| # -- Default Environment variables for Tracer | ||
| ALLOW_INSECURE_TLS: {{ .Values.tracer.configmap.ALLOW_INSECURE_TLS | default "true" | quote }} | ||
| ENV_NAME: {{ .Values.tracer.configmap.ENV_NAME | default "development" | quote }} | ||
|
|
||
| # APP | ||
| SERVER_PORT: {{ .Values.tracer.configmap.SERVER_PORT | default "4020" | quote }} | ||
| SERVER_ADDRESS: {{ .Values.tracer.configmap.SERVER_ADDRESS | default ":4020" | quote }} | ||
| VERSION: {{ .Values.tracer.image.tag | default .Chart.AppVersion | quote }} | ||
|
|
||
| # LOG LEVEL | ||
| LOG_LEVEL: {{ .Values.tracer.configmap.LOG_LEVEL | default "info" | quote }} | ||
|
|
||
| # AUTHENTICATION | ||
| API_KEY_ENABLED: {{ .Values.tracer.configmap.API_KEY_ENABLED | default "false" | quote }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Mirror the v4 API-key validation at render time. |
||
|
|
||
| # CORS | ||
| CORS_ALLOWED_ORIGINS: {{ .Values.tracer.configmap.CORS_ALLOWED_ORIGINS | default "*" | quote }} | ||
|
|
||
| # AUTH PLUGIN (Access Manager) | ||
| PLUGIN_AUTH_ENABLED: {{ .Values.tracer.configmap.PLUGIN_AUTH_ENABLED | default "false" | quote }} | ||
| PLUGIN_AUTH_ADDRESS: {{ .Values.tracer.configmap.PLUGIN_AUTH_ADDRESS | default "http://plugin-access-manager-auth:4000" | quote }} | ||
|
|
||
| # PostgreSQL Database | ||
| DB_HOST: {{ .Values.tracer.configmap.DB_HOST | default "midaz-postgresql" | quote }} | ||
| DB_PORT: {{ .Values.tracer.configmap.DB_PORT | default "5432" | quote }} | ||
| DB_NAME: {{ .Values.tracer.configmap.DB_NAME | default "tracer" | quote }} | ||
| DB_USER: {{ .Values.tracer.configmap.DB_USER | default "tracer" | quote }} | ||
| DB_SSL_MODE: {{ .Values.tracer.configmap.DB_SSL_MODE | default "disable" | quote }} | ||
| MIGRATIONS_PATH: {{ .Values.tracer.configmap.MIGRATIONS_PATH | default "./migrations" | quote }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Render the dedicated migration runner instead of passing |
||
|
|
||
| # SWAGGER | ||
| SWAGGER_TITLE: {{ .Values.tracer.configmap.SWAGGER_TITLE | default "Tracer API" | quote }} | ||
| SWAGGER_DESCRIPTION: {{ .Values.tracer.configmap.SWAGGER_DESCRIPTION | default "Real-time transaction validation and fraud prevention API" | quote }} | ||
| SWAGGER_HOST: {{ .Values.tracer.configmap.SWAGGER_HOST | default ":4020" | quote }} | ||
| SWAGGER_BASE_PATH: {{ .Values.tracer.configmap.SWAGGER_BASE_PATH | default "/" | quote }} | ||
| SWAGGER_SCHEMES: {{ .Values.tracer.configmap.SWAGGER_SCHEMES | default "http" | quote }} | ||
|
|
||
| # CEL Expression Engine | ||
| CEL_COST_LIMIT: {{ .Values.tracer.configmap.CEL_COST_LIMIT | default "10000" | quote }} | ||
|
|
||
| # OPEN TELEMETRY | ||
| OTEL_RESOURCE_SERVICE_NAME: {{ .Values.tracer.configmap.OTEL_RESOURCE_SERVICE_NAME | default "midaz-tracer" | quote }} | ||
| OTEL_LIBRARY_NAME: {{ .Values.tracer.configmap.OTEL_LIBRARY_NAME | default "github.com/LerianStudio/tracer" | quote }} | ||
| OTEL_RESOURCE_SERVICE_VERSION: {{ .Values.tracer.image.tag | default .Chart.AppVersion | quote }} | ||
| OTEL_RESOURCE_DEPLOYMENT_ENVIRONMENT: {{ .Values.tracer.configmap.ENV_NAME | default "development" | quote }} | ||
| OTEL_EXPORTER_OTLP_ENDPOINT: {{ .Values.tracer.configmap.OTEL_EXPORTER_OTLP_ENDPOINT | default "" | quote }} | ||
| ENABLE_TELEMETRY: {{ .Values.tracer.configmap.ENABLE_TELEMETRY | default "false" | quote }} | ||
|
|
||
| # CLEANUP WORKER | ||
| CLEANUP_WORKER_ENABLED: {{ .Values.tracer.configmap.CLEANUP_WORKER_ENABLED | default "false" | quote }} | ||
| CLEANUP_INTERVAL_HOURS: {{ .Values.tracer.configmap.CLEANUP_INTERVAL_HOURS | default "24" | quote }} | ||
|
|
||
| # MULTI-TENANT | ||
| MULTI_TENANT_ENABLED: {{ .Values.tracer.configmap.MULTI_TENANT_ENABLED | default "false" | quote }} | ||
| {{- if eq (.Values.tracer.configmap.MULTI_TENANT_ENABLED | default "false" | toString) "true" }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Complete the multi-tenant fail-fast validation. The v4 bootstrap requires |
||
| MULTI_TENANT_URL: {{ required "tracer.configmap.MULTI_TENANT_URL is required when MULTI_TENANT_ENABLED=true" .Values.tracer.configmap.MULTI_TENANT_URL | quote }} | ||
| MULTI_TENANT_ALLOW_INSECURE_HTTP: {{ .Values.tracer.configmap.MULTI_TENANT_ALLOW_INSECURE_HTTP | default "false" | quote }} | ||
| MULTI_TENANT_REDIS_HOST: {{ required "tracer.configmap.MULTI_TENANT_REDIS_HOST is required when MULTI_TENANT_ENABLED=true" .Values.tracer.configmap.MULTI_TENANT_REDIS_HOST | quote }} | ||
| MULTI_TENANT_REDIS_PORT: {{ .Values.tracer.configmap.MULTI_TENANT_REDIS_PORT | default "6379" | quote }} | ||
| MULTI_TENANT_REDIS_TLS: {{ .Values.tracer.configmap.MULTI_TENANT_REDIS_TLS | default "true" | quote }} | ||
| MULTI_TENANT_MAX_TENANT_POOLS: {{ .Values.tracer.configmap.MULTI_TENANT_MAX_TENANT_POOLS | default "100" | quote }} | ||
| MULTI_TENANT_IDLE_TIMEOUT_SEC: {{ .Values.tracer.configmap.MULTI_TENANT_IDLE_TIMEOUT_SEC | default "300" | quote }} | ||
| MULTI_TENANT_TIMEOUT: {{ .Values.tracer.configmap.MULTI_TENANT_TIMEOUT | default "30" | quote }} | ||
| MULTI_TENANT_CIRCUIT_BREAKER_THRESHOLD: {{ .Values.tracer.configmap.MULTI_TENANT_CIRCUIT_BREAKER_THRESHOLD | default "5" | quote }} | ||
| MULTI_TENANT_CIRCUIT_BREAKER_TIMEOUT_SEC: {{ .Values.tracer.configmap.MULTI_TENANT_CIRCUIT_BREAKER_TIMEOUT_SEC | default "30" | quote }} | ||
| MULTI_TENANT_CACHE_TTL_SEC: {{ .Values.tracer.configmap.MULTI_TENANT_CACHE_TTL_SEC | default "120" | quote }} | ||
| MULTI_TENANT_CONNECTIONS_CHECK_INTERVAL_SEC: {{ .Values.tracer.configmap.MULTI_TENANT_CONNECTIONS_CHECK_INTERVAL_SEC | default "30" | quote }} | ||
| {{- if .Values.tracer.configmap.MULTI_TENANT_MAX_OPEN_CONNS_PER_TENANT }} | ||
| MULTI_TENANT_MAX_OPEN_CONNS_PER_TENANT: {{ .Values.tracer.configmap.MULTI_TENANT_MAX_OPEN_CONNS_PER_TENANT | quote }} | ||
| {{- end }} | ||
| {{- if .Values.tracer.configmap.MULTI_TENANT_MAX_IDLE_CONNS_PER_TENANT }} | ||
| MULTI_TENANT_MAX_IDLE_CONNS_PER_TENANT: {{ .Values.tracer.configmap.MULTI_TENANT_MAX_IDLE_CONNS_PER_TENANT | quote }} | ||
| {{- end }} | ||
| {{- end }} | ||
| # Extra Env Vars | ||
| {{- with .Values.tracer.extraEnvVars }} | ||
| {{- toYaml . | nindent 2 }} | ||
| {{- end }} | ||
| {{- end }} | ||
Uh oh!
There was an error while loading. Please reload this page.