Skip to content

Commit 12eea72

Browse files
FEATURE (helm): Use ClusterIP by default and add deployment to ghcr.io
1 parent 75c88ba commit 12eea72

File tree

5 files changed

+167
-91
lines changed

5 files changed

+167
-91
lines changed

.github/workflows/ci-release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,37 @@ jobs:
465465
body: ${{ steps.changelog.outputs.changelog }}
466466
draft: false
467467
prerelease: false
468+
469+
publish-helm-chart:
470+
runs-on: ubuntu-latest
471+
needs: [determine-version, build-and-push]
472+
if: ${{ needs.determine-version.outputs.should_release == 'true' }}
473+
permissions:
474+
contents: read
475+
packages: write
476+
steps:
477+
- name: Check out code
478+
uses: actions/checkout@v4
479+
480+
- name: Set up Helm
481+
uses: azure/setup-helm@v4
482+
with:
483+
version: v3.14.0
484+
485+
- name: Log in to GHCR
486+
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
487+
488+
- name: Update Chart.yaml with release version
489+
run: |
490+
VERSION="${{ needs.determine-version.outputs.new_version }}"
491+
sed -i "s/^version: .*/version: ${VERSION}/" deploy/helm/Chart.yaml
492+
sed -i "s/^appVersion: .*/appVersion: \"v${VERSION}\"/" deploy/helm/Chart.yaml
493+
cat deploy/helm/Chart.yaml
494+
495+
- name: Package Helm chart
496+
run: helm package deploy/helm --destination .
497+
498+
- name: Push Helm chart to GHCR
499+
run: |
500+
VERSION="${{ needs.determine-version.outputs.new_version }}"
501+
helm push postgresus-${VERSION}.tgz oci://ghcr.io/rostislavdugin/charts

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,32 +159,43 @@ docker compose up -d
159159

160160
### Option 4: Kubernetes with Helm
161161

162-
For Kubernetes deployments, use the official Helm chart.
162+
For Kubernetes deployments, install directly from the OCI registry.
163163

164-
**Step 1:** Clone the repository:
164+
**With ClusterIP + port-forward (development/testing):**
165165

166166
```bash
167-
git clone https://github.com/RostislavDugin/postgresus.git
168-
cd postgresus
167+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus \
168+
-n postgresus --create-namespace
169169
```
170170

171-
**Step 2:** Install with Helm:
172-
173171
```bash
174-
helm install postgresus ./deploy/helm -n postgresus --create-namespace
172+
kubectl port-forward svc/postgresus-service 4005:4005 -n postgresus
173+
# Access at http://localhost:4005
175174
```
176175

177-
**Step 3:** Get the external IP:
176+
**With LoadBalancer (cloud environments):**
177+
178+
```bash
179+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus \
180+
-n postgresus --create-namespace \
181+
--set service.type=LoadBalancer
182+
```
178183

179184
```bash
180-
kubectl get svc -n postgresus
185+
kubectl get svc postgresus-service -n postgresus
186+
# Access at http://<EXTERNAL-IP>:4005
181187
```
182188

183-
Access Postgresus at `http://<EXTERNAL-IP>` (port 80).
189+
**With Ingress (domain-based access):**
184190

185-
To customize the installation (e.g., storage size, NodePort instead of LoadBalancer), see the [Helm chart README](deploy/helm/README.md) for all configuration options.
191+
```bash
192+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus \
193+
-n postgresus --create-namespace \
194+
--set ingress.enabled=true \
195+
--set ingress.hosts[0].host=backup.example.com
196+
```
186197

187-
Config uses by default LoadBalancer, but has predefined values for Ingress and HTTPRoute as well.
198+
For more options (NodePort, TLS, HTTPRoute for Gateway API), see the [Helm chart README](deploy/helm/README.md).
188199

189200
---
190201

deploy/helm/Chart.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@ apiVersion: v2
22
name: postgresus
33
description: A Helm chart for Postgresus - PostgreSQL backup and management system
44
type: application
5-
version: 1.0.0
6-
appVersion: "v1.45.3"
5+
version: 0.0.0
6+
appVersion: "latest"
77
keywords:
88
- postgresql
99
- backup
1010
- database
1111
- restore
1212
home: https://github.com/RostislavDugin/postgresus
13+
14+
sources:
15+
- https://github.com/RostislavDugin/postgresus
16+
- https://github.com/RostislavDugin/postgresus/tree/main/deploy/helm
17+
18+
maintainers:
19+
- name: Rostislav Dugin
20+
url: https://github.com/RostislavDugin
21+
22+
icon: https://raw.githubusercontent.com/RostislavDugin/postgresus/main/frontend/public/logo.svg

deploy/helm/README.md

Lines changed: 96 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22

33
## Installation
44

5+
Install directly from the OCI registry (no need to clone the repository):
6+
57
```bash
6-
helm install postgresus ./deploy/helm -n postgresus --create-namespace
8+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus -n postgresus --create-namespace
79
```
810

9-
After installation, get the external IP:
11+
## Accessing Postgresus
12+
13+
By default, the chart creates a ClusterIP service. Use port-forward to access:
1014

1115
```bash
12-
kubectl get svc -n postgresus
16+
kubectl port-forward svc/postgresus-service 4005:4005 -n postgresus
1317
```
1418

15-
Access Postgresus at `http://<EXTERNAL-IP>` (port 80).
19+
Then open `http://localhost:4005` in your browser.
1620

1721
## Configuration
1822

@@ -27,14 +31,14 @@ Access Postgresus at `http://<EXTERNAL-IP>` (port 80).
2731
| `image.pullPolicy` | Image pull policy | `Always` |
2832
| `replicaCount` | Number of replicas | `1` |
2933

30-
### Resources
34+
### Service
3135

32-
| Parameter | Description | Default Value |
33-
| --------------------------- | -------------- | ------------- |
34-
| `resources.requests.memory` | Memory request | `1Gi` |
35-
| `resources.requests.cpu` | CPU request | `500m` |
36-
| `resources.limits.memory` | Memory limit | `1Gi` |
37-
| `resources.limits.cpu` | CPU limit | `500m` |
36+
| Parameter | Description | Default Value |
37+
| -------------------------- | ----------------------- | ------------- |
38+
| `service.type` | Service type | `ClusterIP` |
39+
| `service.port` | Service port | `4005` |
40+
| `service.targetPort` | Container port | `4005` |
41+
| `service.headless.enabled` | Enable headless service | `true` |
3842

3943
### Storage
4044

@@ -46,93 +50,76 @@ Access Postgresus at `http://<EXTERNAL-IP>` (port 80).
4650
| `persistence.size` | Storage size | `10Gi` |
4751
| `persistence.mountPath` | Mount path | `/postgresus-data` |
4852

49-
### Service
50-
51-
| Parameter | Description | Default Value |
52-
| -------------------------- | ----------------------- | -------------- |
53-
| `service.type` | Service type | `LoadBalancer` |
54-
| `service.port` | External port | `80` |
55-
| `service.targetPort` | Container port | `4005` |
56-
| `service.headless.enabled` | Enable headless service | `true` |
57-
58-
### Traffic Exposure (3 Options)
59-
60-
The chart supports 3 ways to expose Postgresus:
61-
62-
| Method | Use Case | Default |
63-
| ------ | -------- | ------- |
64-
| **LoadBalancer/NodePort** | Simple cloud clusters | Enabled |
65-
| **Ingress** | Traditional nginx/traefik ingress controllers | Disabled |
66-
| **HTTPRoute (Gateway API)** | Modern gateways (Istio, Envoy, Cilium) | Disabled |
53+
### Resources
6754

68-
#### Ingress
55+
| Parameter | Description | Default Value |
56+
| --------------------------- | -------------- | ------------- |
57+
| `resources.requests.memory` | Memory request | `1Gi` |
58+
| `resources.requests.cpu` | CPU request | `500m` |
59+
| `resources.limits.memory` | Memory limit | `1Gi` |
60+
| `resources.limits.cpu` | CPU limit | `500m` |
6961

70-
| Parameter | Description | Default Value |
71-
| ----------------------- | ----------------- | ------------------------ |
72-
| `ingress.enabled` | Enable Ingress | `false` |
73-
| `ingress.className` | Ingress class | `nginx` |
74-
| `ingress.hosts[0].host` | Hostname | `postgresus.example.com` |
75-
| `ingress.tls` | TLS configuration | `[]` |
62+
## External Access Options
7663

77-
#### HTTPRoute (Gateway API)
64+
### Option 1: Port Forward (Default)
7865

79-
| Parameter | Description | Default Value |
80-
| --------------------- | -------------------------- | ---------------------------------- |
81-
| `route.enabled` | Enable HTTPRoute | `false` |
82-
| `route.apiVersion` | Gateway API version | `gateway.networking.k8s.io/v1` |
83-
| `route.hostnames` | Hostnames for the route | `["postgresus.example.com"]` |
84-
| `route.parentRefs` | Gateway references | `[]` |
85-
| `route.annotations` | Route annotations | `{}` |
66+
Best for development or quick access:
8667

87-
### Health Checks
68+
```bash
69+
kubectl port-forward svc/postgresus-service 4005:4005 -n postgresus
70+
```
8871

89-
| Parameter | Description | Default Value |
90-
| ------------------------ | ---------------------- | ------------- |
91-
| `livenessProbe.enabled` | Enable liveness probe | `true` |
92-
| `readinessProbe.enabled` | Enable readiness probe | `true` |
72+
Access at `http://localhost:4005`
9373

94-
## Examples
74+
### Option 2: NodePort
9575

96-
### Basic Installation (LoadBalancer on port 80)
76+
For direct access via node IP:
9777

98-
Default installation exposes Postgresus via LoadBalancer on port 80:
78+
```yaml
79+
# nodeport-values.yaml
80+
service:
81+
type: NodePort
82+
port: 4005
83+
targetPort: 4005
84+
nodePort: 30080
85+
```
9986
10087
```bash
101-
helm install postgresus ./deploy/helm -n postgresus --create-namespace
88+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus -n postgresus --create-namespace -f nodeport-values.yaml
10289
```
10390

104-
Access via `http://<EXTERNAL-IP>`
91+
Access at `http://<NODE-IP>:30080`
10592

106-
### Using NodePort
93+
### Option 3: LoadBalancer
10794

108-
If your cluster doesn't support LoadBalancer:
95+
For cloud environments with load balancer support:
10996

11097
```yaml
111-
# nodeport-values.yaml
98+
# loadbalancer-values.yaml
11299
service:
113-
type: NodePort
100+
type: LoadBalancer
114101
port: 80
115102
targetPort: 4005
116-
nodePort: 30080
117103
```
118104
119105
```bash
120-
helm install postgresus ./deploy/helm -n postgresus --create-namespace -f nodeport-values.yaml
106+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus -n postgresus --create-namespace -f loadbalancer-values.yaml
107+
```
108+
109+
Get the external IP:
110+
111+
```bash
112+
kubectl get svc -n postgresus
121113
```
122114

123-
Access via `http://<NODE-IP>:30080`
115+
Access at `http://<EXTERNAL-IP>`
124116

125-
### Enable Ingress with HTTPS
117+
### Option 4: Ingress
126118

127119
For domain-based access with TLS:
128120

129121
```yaml
130122
# ingress-values.yaml
131-
service:
132-
type: ClusterIP
133-
port: 4005
134-
targetPort: 4005
135-
136123
ingress:
137124
enabled: true
138125
className: nginx
@@ -151,18 +138,15 @@ ingress:
151138
```
152139
153140
```bash
154-
helm install postgresus ./deploy/helm -n postgresus --create-namespace -f ingress-values.yaml
141+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus -n postgresus --create-namespace -f ingress-values.yaml
155142
```
156143

157-
### HTTPRoute (Gateway API)
144+
### Option 5: HTTPRoute (Gateway API)
158145

159146
For clusters using Istio, Envoy Gateway, Cilium, or other Gateway API implementations:
160147

161148
```yaml
162149
# httproute-values.yaml
163-
service:
164-
type: ClusterIP
165-
166150
route:
167151
enabled: true
168152
hostnames:
@@ -173,10 +157,35 @@ route:
173157
```
174158
175159
```bash
176-
helm install postgresus ./deploy/helm -n postgresus --create-namespace -f httproute-values.yaml
160+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus -n postgresus --create-namespace -f httproute-values.yaml
177161
```
178162

179-
### Custom Storage Size
163+
## Ingress Configuration
164+
165+
| Parameter | Description | Default Value |
166+
| ----------------------- | ----------------- | ------------------------ |
167+
| `ingress.enabled` | Enable Ingress | `false` |
168+
| `ingress.className` | Ingress class | `nginx` |
169+
| `ingress.hosts[0].host` | Hostname | `postgresus.example.com` |
170+
| `ingress.tls` | TLS configuration | `[]` |
171+
172+
## HTTPRoute Configuration
173+
174+
| Parameter | Description | Default Value |
175+
| ------------------ | ----------------------- | ------------------------------ |
176+
| `route.enabled` | Enable HTTPRoute | `false` |
177+
| `route.apiVersion` | Gateway API version | `gateway.networking.k8s.io/v1` |
178+
| `route.hostnames` | Hostnames for the route | `["postgresus.example.com"]` |
179+
| `route.parentRefs` | Gateway references | `[]` |
180+
181+
## Health Checks
182+
183+
| Parameter | Description | Default Value |
184+
| ------------------------ | ---------------------- | ------------- |
185+
| `livenessProbe.enabled` | Enable liveness probe | `true` |
186+
| `readinessProbe.enabled` | Enable readiness probe | `true` |
187+
188+
## Custom Storage Size
180189

181190
```yaml
182191
# storage-values.yaml
@@ -186,5 +195,17 @@ persistence:
186195
```
187196
188197
```bash
189-
helm install postgresus ./deploy/helm -n postgresus --create-namespace -f storage-values.yaml
198+
helm install postgresus oci://ghcr.io/rostislavdugin/charts/postgresus -n postgresus --create-namespace -f storage-values.yaml
199+
```
200+
201+
## Upgrade
202+
203+
```bash
204+
helm upgrade postgresus oci://ghcr.io/rostislavdugin/charts/postgresus -n postgresus
205+
```
206+
207+
## Uninstall
208+
209+
```bash
210+
helm uninstall postgresus -n postgresus
190211
```

deploy/helm/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ replicaCount: 1
1616

1717
# Service configuration
1818
service:
19-
type: LoadBalancer
20-
port: 80 # External port (HTTP default)
19+
type: ClusterIP
20+
port: 4005 # Service port
2121
targetPort: 4005 # Internal container port
2222
# Headless service for StatefulSet
2323
headless:

0 commit comments

Comments
 (0)