Skip to content

Commit 0f6dfef

Browse files
jdenquinCopilot
andauthored
feat(dep): Remove PG and Redis dependencies (#174)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent fe13c12 commit 0f6dfef

22 files changed

Lines changed: 136 additions & 276 deletions

.github/workflows/chart-testing.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ jobs:
1212
fetch-depth: 0
1313

1414
- name: Set up Helm
15-
uses: azure/setup-helm@v3
15+
uses: azure/setup-helm@v4
1616
with:
17-
version: v3.12.1
17+
version: v3.18.4
1818

19-
- name: Set up Python
20-
uses: actions/setup-python@v5
19+
- uses: actions/setup-python@v5.3.0
2120
with:
22-
python-version: "3.10"
21+
python-version: '3.x'
2322
check-latest: true
2423

2524
- name: Set up chart-testing
26-
uses: helm/chart-testing-action@v2.6.1
25+
uses: helm/chart-testing-action@v2.7.0
2726

2827
- name: Run chart-testing (list-changed)
2928
id: list-changed
@@ -41,6 +40,15 @@ jobs:
4140
uses: helm/kind-action@v1.12.0
4241
if: steps.list-changed.outputs.changed == 'true'
4342

43+
- name: Create lago namespace
44+
run: kubectl create namespace lago
45+
46+
- name: Install Postgres
47+
run: kubectl apply -f ./charts/lago/ci/postgres.yml
48+
49+
- name: Install Redis
50+
run: kubectl apply -f ./charts/lago/ci/redis.yml
51+
4452
- name: Run chart-testing (install)
4553
if: steps.list-changed.outputs.changed == 'true'
46-
run: ct install --config ct.yaml
54+
run: ct install --config ct.yaml --namespace lago

README.md

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
# Lago Helm Chart
22

3-
This Helm chart deploys the Lago billing system with various optional dependencies such as Redis, PostgreSQL, and MinIO. Below are details about configuring the chart for different environments.
4-
5-
## Current Releases
6-
7-
| Project | Release Badge |
8-
|--------------------|-----------------------------------------------------------------------------------------------------|
9-
| **Lago** | [![Lago Release](https://img.shields.io/github/v/release/getlago/lago)](https://github.com/getlago/lago/releases) |
10-
| **Helm Chart** | [![Helm Chart Release](https://img.shields.io/github/v/release/getlago/lago-helm-charts)](https://github.com/getlago/lago-helm-charts/releases) |
3+
This Helm chart deploys the Lago billing system with optional dependencies on MinIO. Below are details about configuring the chart for different environments.
114

125

136
## Prerequisites
147

158
- Kubernetes 1.19+
169
- Helm 3.5+
1710
- Persistent storage provisioner enabled in the cluster
18-
- Optionally: A managed Redis, Minio and PostgreSQL service for production environments
11+
- Optionally: Minio service for staging environments
12+
13+
:warning: Please note that we strongly recommend to use managed PostgreSQL, Redis and S3 in a production environment.
1914

2015
## Installation
2116

@@ -53,26 +48,6 @@ helm install my-lago-release . \
5348
| `global.googleAuth.enabled` | Enable or disable logging through Google Auth | `true` |
5449
| `global.ingress.enabled` | Enable ingress resources for the application | `false` |
5550

56-
### Redis Configuration
57-
58-
| Parameter | Description | Default |
59-
|---------------------------------|-----------------------------------------------------|-----------|
60-
| `redis.enabled` | Enable Redis as a dependency | `true` |
61-
| `redis.image.tag` | Redis image tag | `6.2.14` |
62-
| `redis.replica.replicaCount` | Number of Redis replicas | `0` |
63-
| `redis.auth.enabled` | Enable Redis authentication | `false` |
64-
| `redis.master.service.ports` | Redis service port | `6379` |
65-
66-
### PostgreSQL Configuration
67-
68-
| Parameter | Description | Default |
69-
|-------------------------------------|----------------------------------------------------|-----------|
70-
| `postgresql.enabled` | Enable PostgreSQL as a dependency | `true` |
71-
| `global.postgresql.auth.username` | PostgreSQL database username | `lago` |
72-
| `global.postgresql.auth.password` | PostgreSQL database password | `lago` |
73-
| `global.postgresql.auth.database` | PostgreSQL database name | `lago` |
74-
| `global.postgresql.service.ports` | PostgreSQL service port | `5432` |
75-
7651
### Frontend Configuration
7752

7853
| Parameter | Description | Default |
@@ -344,11 +319,11 @@ The following keys are expected:
344319

345320
## Storage Recommendation
346321

347-
We **strongly recommend** using either **Amazon S3** or **MinIO** for object storage when deploying Lago. These solutions provide reliable, scalable storage that can be accessed by multiple pods without encountering issues.
322+
We **strongly recommend** using either **Amazon S3** alternatives for object storage when deploying Lago. These solutions provide reliable, scalable storage that can be accessed by multiple pods without encountering issues.
348323

349324
If neither S3 nor MinIO is configured, the system will default to using a Persistent Volume Claim (PVC). However, this approach is **strongly discouraged** as it can lead to issues such as multi-attach errors when volumes are accessed by more than one pod simultaneously. For this reason, it is important to configure S3 or MinIO to avoid potential complications with PVCs.
350325

351-
By opting for S3 or MinIO, you ensure better reliability and scalability for your deployment.
326+
By opting for S3 or alternatives, you ensure better reliability and scalability for your deployment.
352327

353328
For additional customization, refer to the comments in `values.yaml`.
354329

charts/lago/.helmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
.gitignore
44
LICENSE
55
README.md
6-
artifacts/
6+
artifacts/
7+
ci/postgres.yml
8+
ci/redis.yml

charts/lago/Chart.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,8 @@ apiVersion: v2
22
appVersion: "1.32.4"
33
description: the Lago open source billing app
44
name: lago
5-
version: 1.24.2
5+
version: 1.25.0
66
dependencies:
7-
- name: postgresql
8-
version: "13.2.2"
9-
repository: https://charts.bitnami.com/bitnami
10-
condition: postgresql.enabled
11-
- name: redis
12-
version: "18.2.1"
13-
repository: https://charts.bitnami.com/bitnami
14-
condition: redis.enabled
157
- name: minio
168
version: "5.2.0"
179
repository: https://charts.min.io/

charts/lago/ci/basic-values.yaml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
apiUrl: "api.lago.dev"
22
frontUrl: "front.lago.dev"
3+
4+
global:
5+
databaseUrl: postgres://postgres:postgres@postgres:5432/postgres
6+
redisUrl: redis://redis:6379
7+
38
job:
49
migrate:
510
loadSchema: true
@@ -16,10 +21,18 @@ worker:
1621
cpu: "200m"
1722

1823
eventsWorker:
19-
enabled: false
24+
enabled: true
25+
resources:
26+
requests:
27+
memory: '512Mi'
28+
cpu: "200m"
2029

2130
clockWorker:
22-
enabled: false
31+
enabled: true
32+
resources:
33+
requests:
34+
memory: '512Mi'
35+
cpu: "200m"
2336

2437
pdf:
2538
resources:
@@ -28,13 +41,29 @@ pdf:
2841
cpu: "200m"
2942

3043
billingWorker:
31-
enabled: false
44+
enabled: true
45+
resources:
46+
requests:
47+
memory: '512Mi'
48+
cpu: "200m"
3249

3350
pdfWorker:
34-
enabled: false
51+
enabled: true
52+
resources:
53+
requests:
54+
memory: '512Mi'
55+
cpu: "200m"
3556

3657
webhookWorker:
37-
enabled: false
58+
enabled: true
59+
resources:
60+
requests:
61+
memory: '512Mi'
62+
cpu: "200m"
3863

3964
paymentWorker:
40-
enabled: false
65+
enabled: true
66+
resources:
67+
requests:
68+
memory: '512Mi'
69+
cpu: "200m"

charts/lago/ci/dedicated-workers-values.yaml

Lines changed: 0 additions & 64 deletions
This file was deleted.

charts/lago/ci/postgres.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: postgres
5+
namespace: lago
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: postgres
11+
template:
12+
metadata:
13+
labels:
14+
app: postgres
15+
spec:
16+
containers:
17+
- name: postgres
18+
image: postgres:15-alpine
19+
ports:
20+
- containerPort: 5432
21+
env:
22+
- name: POSTGRES_PASSWORD
23+
value: postgres
24+
- name: POSTGRES_USER
25+
value: postgres
26+
- name: POSTGRES_DB
27+
value: lago
28+
---
29+
apiVersion: v1
30+
kind: Service
31+
metadata:
32+
name: postgres
33+
namespace: lago
34+
spec:
35+
type: ClusterIP
36+
selector:
37+
app: postgres
38+
ports:
39+
- port: 5432
40+
targetPort: 5432

charts/lago/ci/redis.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: redis
5+
namespace: lago
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: redis
11+
template:
12+
metadata:
13+
labels:
14+
app: redis
15+
spec:
16+
containers:
17+
- name: redis
18+
image: redis:alpine
19+
ports:
20+
- containerPort: 6379
21+
---
22+
apiVersion: v1
23+
kind: Service
24+
metadata:
25+
name: redis
26+
namespace: lago
27+
spec:
28+
type: ClusterIP
29+
selector:
30+
app: redis
31+
ports:
32+
- port: 6379
33+
targetPort: 6379

charts/lago/templates/api-deployment.yaml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,6 @@ spec:
3636
{{- toYaml . | nindent 8 }}
3737
{{- end }}
3838
initContainers:
39-
{{ if .Values.postgresql.enabled }}
40-
- name: wait-for-postgresql
41-
image: "docker.io/bitnami/kubectl:{{ include "kubectlVersion" . }}"
42-
args:
43-
- wait
44-
- pod/{{ .Release.Name }}-postgresql-0
45-
- --for=condition=ready
46-
- --timeout=180s
47-
{{ end }}
48-
{{ if .Values.redis.enabled }}
49-
- name: wait-for-redis
50-
image: "docker.io/bitnami/kubectl:{{ include "kubectlVersion" . }}"
51-
args:
52-
- wait
53-
- pod/{{ .Release.Name }}-redis-master-0
54-
- --for=condition=ready
55-
- --timeout=180s
56-
{{ end }}
5739
{{ if .Values.minio.enabled }}
5840
- name: wait-for-minio
5941
image: "docker.io/bitnami/kubectl:{{ include "kubectlVersion" . }}"

charts/lago/templates/billing-worker-deployment.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ spec:
3737
{{- toYaml . | nindent 8 }}
3838
{{- end }}
3939
initContainers:
40-
{{ if .Values.redis.enabled }}
41-
- name: wait-for-redis
42-
image: "docker.io/bitnami/kubectl:{{ include "kubectlVersion" . }}"
43-
args:
44-
- wait
45-
- pod/{{ .Release.Name }}-redis-master-0
46-
- --for=condition=ready
47-
- --timeout=180s
48-
{{ end }}
4940
- name: wait-for-migrations
5041
image: "docker.io/bitnami/kubectl:{{ include "kubectlVersion" . }}"
5142
args:

0 commit comments

Comments
 (0)