Skip to content

Commit 5796670

Browse files
authored
Merge pull request #1154 from LerianStudio/feat/add-plugin-br-pix-switch-chart
feat(plugin-br-pix-switch): add new helm chart
2 parents d9ae314 + 78e4615 commit 5796670

19 files changed

Lines changed: 912 additions & 0 deletions

File tree

.github/configs/labeler.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ plugin-br-pix-indirect-btg:
2929
plugin-br-pix-direct-jd:
3030
- changed-files:
3131
- any-glob-to-any-file: charts/plugin-br-pix-direct-jd/**
32+
33+
plugin-br-pix-switch:
34+
- changed-files:
35+
- any-glob-to-any-file: charts/plugin-br-pix-switch/**
3236

3337
product-console:
3438
- changed-files:

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [ ] Plugin Fees
1111
- [ ] Plugin BR PIX Direct JD
1212
- [ ] Plugin BR PIX Indirect BTG
13+
- [ ] Plugin BR PIX Switch
1314
- [ ] Otel Collector
1415
- [ ] Pipeline
1516
- [ ] Documentation

.github/workflows/gptchangelog.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
charts/plugin-access-manager
3131
charts/plugin-br-pix-direct-jd
3232
charts/plugin-br-pix-indirect-btg
33+
charts/plugin-br-pix-switch
3334
charts/plugin-crm
3435
charts/plugin-fees
3536
charts/product-console

.github/workflows/pr-title.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
plugin-fees
3939
plugin-br-pix-direct-jd
4040
plugin-br-pix-indirect-btg
41+
plugin-br-pix-switch
4142
plugin-br-bank-transfer-jd
4243
templates
4344
dependencies

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ For implementation and configuration details, see the [README](https://charts.le
9797
| `2.1.0-beta.1` | 1.2.1-beta.11 | 1.2.1-beta.11 |
9898
-----------------
9999

100+
### Plugin BR Pix Switch
101+
102+
For implementation and configuration details, see the [README](https://charts.lerian.studio/charts/plugin-br-pix-switch).
103+
104+
#### Application Version Mapping
105+
106+
| Chart Version | App Version |
107+
| :---: | :---: |
108+
| `1.0.0` | 1.0.0-beta.1 |
109+
-----------------
110+
100111
### Plugin BR Pix Indirect BTG
101112

102113
See the [official documentation](https://docs.lerian.studio/en/midaz/plugins/pix/indirect-pix-btg) for details.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
## [1.0.0] - 2026-03-27
4+
5+
### Added
6+
7+
- Initial chart release for plugin-br-pix-switch
8+
- Single Go service deployment (HTTP port 4000, gRPC port 7001)
9+
- PostgreSQL dependency (Bitnami subchart v16.3)
10+
- Valkey dependency (Bitnami subchart v2.4.6)
11+
- HPA, PDB, Ingress support
12+
- OpenTelemetry integration
13+
- Readiness and liveness probes
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: v2
2+
name: plugin-br-pix-switch-helm
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
6+
home: https://github.com/LerianStudio/helm
7+
8+
# A list of maintainers who are responsible for the chart
9+
maintainers:
10+
- name: "Lerian Studio"
11+
email: "support@lerian.studio"
12+
13+
# This is the chart version. This version number should be incremented each time you make changes
14+
# to the chart and its templates, including the app version.
15+
16+
version: 1.0.0
17+
18+
# This is the version number of the application being deployed.
19+
appVersion: "1.0.0-beta.1"
20+
21+
# A list of keywords about the chart. This helps others discover the chart.
22+
keywords:
23+
- midaz
24+
- lerian
25+
- ledger
26+
- plugins
27+
- pix
28+
- switch
29+
30+
# The URL to an icon file for this chart. Or the icon data.
31+
icon: https://avatars.githubusercontent.com/u/148895005?s=200&v=4
32+
33+
# This Helm chart includes multiple dependencies required for the application.
34+
# To understand the purpose and configuration of each dependency, visit:
35+
# https://docs.lerian.studio/docs/midaz-components
36+
dependencies:
37+
- name: postgresql
38+
version: "16.3"
39+
repository: "https://charts.bitnami.com/bitnami"
40+
condition: postgresql.enabled
41+
- name: valkey
42+
version: "2.4.6"
43+
repository: "oci://registry-1.docker.io/bitnamicharts"
44+
condition: valkey.enabled
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Plugin BR Pix Switch Helm Chart
2+
3+
Helm chart for deploying the Plugin BR Pix Switch service on Kubernetes.
4+
5+
## Overview
6+
7+
This chart deploys a single Go microservice for PIX switching operations, along with its dependencies:
8+
9+
- **Plugin BR Pix Switch** - Main API service (HTTP port 4000, gRPC port 7001)
10+
- **PostgreSQL** - Primary database (Bitnami subchart)
11+
- **Valkey** - Redis-compatible cache (Bitnami subchart)
12+
- **OpenTelemetry Collector** - Observability (Lerian subchart)
13+
14+
## Prerequisites
15+
16+
- Kubernetes 1.23+ (uses `autoscaling/v2` HPA and `policy/v1` PDB)
17+
- Helm 3.x
18+
19+
## Installation
20+
21+
```bash
22+
# Add dependencies
23+
helm dependency build
24+
25+
# Install the chart
26+
helm install plugin-br-pix-switch . -n midaz-plugins --create-namespace
27+
```
28+
29+
## Configuration
30+
31+
### Key Values
32+
33+
| Parameter | Description | Default |
34+
|-----------|-------------|---------|
35+
| `pixSwitch.image.repository` | Container image repository | `ghcr.io/lerianstudio/plugin-br-pix-switch` |
36+
| `pixSwitch.image.tag` | Container image tag | `1.0.0-beta.1` |
37+
| `pixSwitch.service.port` | HTTP service port | `4000` |
38+
| `pixSwitch.service.grpcPort` | gRPC service port | `7001` |
39+
| `pixSwitch.replicaCount` | Number of replicas | `1` |
40+
| `pixSwitch.autoscaling.enabled` | Enable HPA | `true` |
41+
| `pixSwitch.ingress.enabled` | Enable ingress | `false` |
42+
| `postgresql.enabled` | Enable PostgreSQL subchart | `true` |
43+
| `valkey.enabled` | Enable Valkey subchart | `true` |
44+
45+
### Health Endpoints
46+
47+
The service exposes the following health endpoints:
48+
49+
- `/health` - General health check
50+
- `/ready` - Readiness probe (used by Kubernetes)
51+
- `/live` - Liveness probe (used by Kubernetes)
52+
53+
### Using External Database
54+
55+
To use an external PostgreSQL database instead of the bundled subchart:
56+
57+
```yaml
58+
postgresql:
59+
enabled: false
60+
61+
pixSwitch:
62+
configmap:
63+
DB_HOST: "your-external-db-host"
64+
DB_USER: "your-db-user"
65+
DB_NAME: "your-db-name"
66+
DB_PORT: "5432"
67+
secrets:
68+
DB_PASSWORD: "your-db-password"
69+
```
70+
71+
### Using External Cache
72+
73+
To use an external Redis/Valkey instance:
74+
75+
```yaml
76+
valkey:
77+
enabled: false
78+
79+
pixSwitch:
80+
configmap:
81+
VALKEY_HOST: "your-external-cache-host"
82+
VALKEY_PORT: "6379"
83+
secrets:
84+
VALKEY_PASSWORD: "your-cache-password"
85+
```
86+
87+
## Production Notes
88+
89+
- The bundled PostgreSQL and Valkey subcharts are intended for **development only**
90+
- For production, use managed database and cache services
91+
- Configure `pixSwitch.useExistingSecrets: true` to use pre-existing Kubernetes secrets
92+
- Enable ingress and TLS for external access
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
============================================================
2+
Plugin BR Pix Switch - Helm Chart Deployment Summary
3+
============================================================
4+
5+
Release Name: {{ .Release.Name }}
6+
Namespace: {{ .Release.Namespace }}
7+
Chart: {{ .Chart.Name }}-{{ .Chart.Version }}
8+
App Version: {{ .Chart.AppVersion }}
9+
10+
------------------------------------------------------------
11+
Main API Service (pixSwitch)
12+
------------------------------------------------------------
13+
Service: {{ include "plugin-br-pix-switch.fullname" . }}
14+
HTTP Port: {{ .Values.pixSwitch.service.port }}
15+
gRPC Port: {{ .Values.pixSwitch.service.grpcPort }}
16+
Type: {{ .Values.pixSwitch.service.type }}
17+
18+
In-cluster access (HTTP):
19+
curl http://{{ include "plugin-br-pix-switch.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.pixSwitch.service.port }}/ready
20+
21+
In-cluster access (gRPC):
22+
{{ include "plugin-br-pix-switch.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.pixSwitch.service.grpcPort }}
23+
24+
{{- if .Values.pixSwitch.ingress.enabled }}
25+
26+
Ingress: Enabled
27+
{{- range .Values.pixSwitch.ingress.hosts }}
28+
Host: {{ .host }}
29+
{{- end }}
30+
{{- else }}
31+
Ingress: Disabled
32+
{{- end }}
33+
34+
------------------------------------------------------------
35+
Autoscaling & Availability
36+
------------------------------------------------------------
37+
{{- if .Values.pixSwitch.autoscaling.enabled }}
38+
HPA: Enabled
39+
Min Replicas: {{ .Values.pixSwitch.autoscaling.minReplicas }}
40+
Max Replicas: {{ .Values.pixSwitch.autoscaling.maxReplicas }}
41+
CPU Target: {{ .Values.pixSwitch.autoscaling.targetCPUUtilizationPercentage | default "N/A" }}%
42+
Memory Target: {{ .Values.pixSwitch.autoscaling.targetMemoryUtilizationPercentage | default "N/A" }}%
43+
{{- else }}
44+
HPA: Disabled
45+
Replicas: {{ .Values.pixSwitch.replicaCount }}
46+
{{- end }}
47+
{{- if .Values.pixSwitch.pdb.enabled }}
48+
PDB: Enabled (maxUnavailable: {{ .Values.pixSwitch.pdb.maxUnavailable }})
49+
{{- else }}
50+
PDB: Disabled
51+
{{- end }}
52+
53+
------------------------------------------------------------
54+
Secrets & Configuration
55+
------------------------------------------------------------
56+
ConfigMap: {{ include "plugin-br-pix-switch.fullname" . }}
57+
{{- if .Values.pixSwitch.useExistingSecrets }}
58+
Secret: {{ .Values.pixSwitch.existingSecretName }} (existing)
59+
{{- else }}
60+
Secret: {{ include "plugin-br-pix-switch.fullname" . }}
61+
{{- end }}
62+
63+
------------------------------------------------------------
64+
PostgreSQL
65+
------------------------------------------------------------
66+
{{- if .Values.postgresql.enabled }}
67+
Status: Enabled (Bitnami subchart)
68+
Database: {{ .Values.postgresql.auth.database }}
69+
Username: {{ .Values.postgresql.auth.username }}
70+
In-cluster: {{ .Release.Name }}-postgresql.{{ .Release.Namespace }}.svc.cluster.local:5432
71+
72+
WARNING: Bitnami PostgreSQL is intended for development only.
73+
For production, use an external managed database and set postgresql.enabled=false.
74+
{{- else }}
75+
Status: Disabled (using external database)
76+
{{- end }}
77+
78+
------------------------------------------------------------
79+
Valkey (Redis-compatible)
80+
------------------------------------------------------------
81+
{{- if .Values.valkey.enabled }}
82+
Status: Enabled (Bitnami subchart)
83+
Architecture: {{ .Values.valkey.architecture }}
84+
In-cluster: {{ .Release.Name }}-valkey-primary.{{ .Release.Namespace }}.svc.cluster.local:6379
85+
86+
WARNING: Bitnami Valkey is intended for development only.
87+
For production, use an external managed cache and set valkey.enabled=false.
88+
{{- else }}
89+
Status: Disabled (using external cache)
90+
{{- end }}
91+
92+
------------------------------------------------------------
93+
Useful Commands
94+
------------------------------------------------------------
95+
# Get all resources
96+
kubectl get all -l app.kubernetes.io/instance={{ .Release.Name }} -n {{ .Release.Namespace }}
97+
98+
# Check pod status
99+
kubectl get pods -l app.kubernetes.io/instance={{ .Release.Name }} -n {{ .Release.Namespace }}
100+
101+
# View logs
102+
kubectl logs -l app.kubernetes.io/name={{ include "plugin-br-pix-switch.name" . }} -n {{ .Release.Namespace }} -f
103+
104+
# Describe service
105+
kubectl describe svc {{ include "plugin-br-pix-switch.fullname" . }} -n {{ .Release.Namespace }}
106+
107+
============================================================
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{{/*
2+
Expand the name of the chart and plugin pix-switch.
3+
*/}}
4+
{{- define "plugin-br-pix-switch.name" -}}
5+
{{- default (default .Values.pixSwitch.name) | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create chart name and version as used by the chart label for plugin pix-switch.
10+
*/}}
11+
{{- define "plugin-br-pix-switch.chart" -}}
12+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
13+
{{- end }}
14+
15+
{{/*
16+
Create a default fully qualified app name pix-switch.
17+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
18+
If release name contains chart name it will be used as a full name.
19+
*/}}
20+
{{- define "plugin-br-pix-switch.fullname" -}}
21+
{{- default .Values.pixSwitch.name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
24+
{{/*
25+
Create app version.
26+
*/}}
27+
{{- define "plugin.version" -}}
28+
{{- printf "%s" .Chart.AppVersion | replace "+" "_" | trunc 63 | trimSuffix "-" }}
29+
{{- end }}
30+
31+
{{/*
32+
plugin-br-pix-switch Selector labels
33+
*/}}
34+
{{- define "plugin-br-pix-switch.selectorLabels" -}}
35+
{{- if .name -}}
36+
app.kubernetes.io/name: {{ include "plugin-br-pix-switch.name" .context }}
37+
{{- end }}
38+
app.kubernetes.io/instance: {{ .context.Release.Name }}
39+
{{- end }}
40+
41+
{{/*
42+
pix-switch Common labels
43+
*/}}
44+
{{- define "plugin-br-pix-switch.labels" -}}
45+
helm.sh/chart: {{ include "plugin-br-pix-switch.chart" .context }}
46+
{{ include "plugin-br-pix-switch.selectorLabels" (dict "context" .context "name" .name) }}
47+
app.kubernetes.io/version: {{ include "plugin.version" .context }}
48+
app.kubernetes.io/managed-by: {{ .context.Release.Service }}
49+
{{- end }}
50+
51+
{{/*
52+
Create the name of the plugin-br-pix-switch service account to use
53+
*/}}
54+
{{- define "plugin-br-pix-switch.serviceAccountName" -}}
55+
{{- if .Values.pixSwitch.serviceAccount.create }}
56+
{{- default (include "plugin-br-pix-switch.fullname" .) .Values.pixSwitch.serviceAccount.name }}
57+
{{- else }}
58+
{{- default "default" .Values.pixSwitch.serviceAccount.name }}
59+
{{- end }}
60+
{{- end }}
61+
62+
{{/*
63+
Expand the namespace of the release.
64+
Allows overriding it for multi-namespace deployments in combined charts.
65+
*/}}
66+
{{- define "global.namespace" -}}
67+
{{- default .Release.Namespace .Values.pixSwitch.namespaceOverride | trunc 63 | trimSuffix "-" -}}
68+
{{- end }}

0 commit comments

Comments
 (0)