Skip to content

Commit ba37b30

Browse files
FEATURE (helm): Add Helm chart installation
1 parent 34b3f82 commit ba37b30

File tree

11 files changed

+134
-203
lines changed

11 files changed

+134
-203
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,40 @@ Then run:
157157
docker compose up -d
158158
```
159159

160+
### Option 4: Kubernetes with Helm
161+
162+
For Kubernetes deployments, use the official Helm chart:
163+
164+
```bash
165+
helm install postgresus ./deploy/postgresus -n postgresus --create-namespace
166+
```
167+
168+
To customize the installation, create a `values.yaml` file:
169+
170+
```yaml
171+
ingress:
172+
hosts:
173+
- host: backup.yourdomain.com
174+
paths:
175+
- path: /
176+
pathType: Prefix
177+
tls:
178+
- secretName: backup-yourdomain-com-tls
179+
hosts:
180+
- backup.yourdomain.com
181+
182+
persistence:
183+
size: 20Gi
184+
```
185+
186+
Then install with your custom values:
187+
188+
```bash
189+
helm install postgresus ./deploy/postgresus -n postgresus --create-namespace -f values.yaml
190+
```
191+
192+
See the [Helm chart README](deploy/postgresus/README.md) for all configuration options.
193+
160194
---
161195

162196
## 🚀 Usage
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ keywords:
1010
- database
1111
- restore
1212
home: https://github.com/RostislavDugin/postgresus
13-
maintainers:
14-
- name: Alexander Gazal
15-

deploy/postgresus/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Postgresus Helm Chart
2+
3+
## Installation
4+
5+
```bash
6+
helm install postgresus ./deploy/postgresus -n postgresus --create-namespace
7+
```
8+
9+
## Configuration
10+
11+
### Main Parameters
12+
13+
| Parameter | Description | Default Value |
14+
| ------------------ | ------------------ | --------------------------- |
15+
| `namespace.create` | Create namespace | `true` |
16+
| `namespace.name` | Namespace name | `postgresus` |
17+
| `image.repository` | Docker image | `rostislavdugin/postgresus` |
18+
| `image.tag` | Image tag | `latest` |
19+
| `image.pullPolicy` | Image pull policy | `Always` |
20+
| `replicaCount` | Number of replicas | `1` |
21+
22+
### Resources
23+
24+
| Parameter | Description | Default Value |
25+
| --------------------------- | -------------- | ------------- |
26+
| `resources.requests.memory` | Memory request | `1Gi` |
27+
| `resources.requests.cpu` | CPU request | `500m` |
28+
| `resources.limits.memory` | Memory limit | `1Gi` |
29+
| `resources.limits.cpu` | CPU limit | `500m` |
30+
31+
### Storage
32+
33+
| Parameter | Description | Default Value |
34+
| ------------------------------ | ------------------------- | ---------------------- |
35+
| `persistence.enabled` | Enable persistent storage | `true` |
36+
| `persistence.storageClassName` | Storage class | `""` (cluster default) |
37+
| `persistence.accessMode` | Access mode | `ReadWriteOnce` |
38+
| `persistence.size` | Storage size | `10Gi` |
39+
| `persistence.mountPath` | Mount path | `/postgresus-data` |
40+
41+
### Service
42+
43+
| Parameter | Description | Default Value |
44+
| -------------------------- | ----------------------- | ------------- |
45+
| `service.type` | Service type | `ClusterIP` |
46+
| `service.port` | Service port | `4005` |
47+
| `service.targetPort` | Target port | `4005` |
48+
| `service.headless.enabled` | Enable headless service | `true` |
49+
50+
### Ingress
51+
52+
| Parameter | Description | Default Value |
53+
| ----------------------- | ----------------- | ------------------------ |
54+
| `ingress.enabled` | Enable Ingress | `true` |
55+
| `ingress.className` | Ingress class | `nginx` |
56+
| `ingress.hosts[0].host` | Hostname | `postgresus.example.com` |
57+
| `ingress.tls` | TLS configuration | See values.yaml |
58+
59+
### Health Checks
60+
61+
| Parameter | Description | Default Value |
62+
| ------------------------ | ---------------------- | ------------- |
63+
| `livenessProbe.enabled` | Enable liveness probe | `true` |
64+
| `readinessProbe.enabled` | Enable readiness probe | `true` |
65+
66+
## Custom Ingress Example
67+
68+
```yaml
69+
# custom-values.yaml
70+
ingress:
71+
hosts:
72+
- host: backup.example.com
73+
paths:
74+
- path: /
75+
pathType: Prefix
76+
tls:
77+
- secretName: backup-example-com-tls
78+
hosts:
79+
- backup.example.com
80+
```
81+
82+
```bash
83+
helm install postgresus ./deploy/postgresus -n postgresus --create-namespace -f custom-values.yaml
84+
```
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ spec:
7171
spec:
7272
accessModes:
7373
- {{ .Values.persistence.accessMode }}
74+
{{- if .Values.persistence.storageClassName }}
7475
storageClassName: {{ .Values.persistence.storageClassName }}
76+
{{- end }}
7577
resources:
7678
requests:
7779
storage: {{ .Values.persistence.size }}
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace:
88
# Image configuration
99
image:
1010
repository: rostislavdugin/postgresus
11-
tag: v1.45.3
12-
pullPolicy: IfNotPresent
11+
tag: latest
12+
pullPolicy: Always
1313

1414
# StatefulSet configuration
1515
replicaCount: 1
@@ -26,16 +26,18 @@ service:
2626
# Resource limits and requests
2727
resources:
2828
requests:
29-
memory: "512Mi"
30-
cpu: "250m"
29+
memory: "1Gi"
30+
cpu: "500m"
3131
limits:
3232
memory: "1Gi"
3333
cpu: "500m"
3434

3535
# Persistent storage configuration
3636
persistence:
3737
enabled: true
38-
storageClassName: longhorn-pg
38+
# Storage class name. Leave empty to use cluster default.
39+
# Examples: "longhorn", "standard", "gp2", etc.
40+
storageClassName: ""
3941
accessMode: ReadWriteOnce
4042
size: 10Gi
4143
# Mount path in container
@@ -71,23 +73,24 @@ ingress:
7173
hosts:
7274
- postgresus.example.com
7375

74-
# Health checks configuration (commented out by default)
76+
# Health checks configuration
77+
# Note: The application only has /api/v1/system/health endpoint
7578
livenessProbe:
76-
enabled: false
79+
enabled: true
7780
httpGet:
78-
path: /health
81+
path: /api/v1/system/health
7982
port: 4005
8083
initialDelaySeconds: 30
8184
periodSeconds: 10
8285
timeoutSeconds: 5
8386
failureThreshold: 3
8487

8588
readinessProbe:
86-
enabled: false
89+
enabled: true
8790
httpGet:
88-
path: /ready
91+
path: /api/v1/system/health
8992
port: 4005
90-
initialDelaySeconds: 5
93+
initialDelaySeconds: 10
9194
periodSeconds: 5
9295
timeoutSeconds: 3
9396
failureThreshold: 3

0 commit comments

Comments
 (0)