PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
FEATURE (helm): Add Helm chart installation
Rostislav Duginba37b30e8369
diff --git a/README.md b/README.mdindex 3996b201..e3c31b4b 100644--- a/README.md+++ b/README.md@@ -157,6 +157,40 @@ Then run:docker compose up -d```+### Option 4: Kubernetes with Helm++For Kubernetes deployments, use the official Helm chart:++```bash+helm install postgresus ./deploy/postgresus -n postgresus --create-namespace+```++To customize the installation, create a `values.yaml` file:++```yaml+ingress:+ hosts:+ - host: backup.yourdomain.com+ paths:+ - path: /+ pathType: Prefix+ tls:+ - secretName: backup-yourdomain-com-tls+ hosts:+ - backup.yourdomain.com++persistence:+ size: 20Gi+```++Then install with your custom values:++```bash+helm install postgresus ./deploy/postgresus -n postgresus --create-namespace -f values.yaml+```++See the [Helm chart README](deploy/postgresus/README.md) for all configuration options.+---## 🚀 Usagediff --git a/postgresus/.helmignore b/deploy/postgresus/.helmignoresimilarity index 100%rename from postgresus/.helmignorerename to deploy/postgresus/.helmignorediff --git a/postgresus/Chart.yaml b/deploy/postgresus/Chart.yamlsimilarity index 79%rename from postgresus/Chart.yamlrename to deploy/postgresus/Chart.yamlindex 5f7320a0..4fdf0b53 100644--- a/postgresus/Chart.yaml+++ b/deploy/postgresus/Chart.yaml@@ -10,6 +10,3 @@ keywords:- database- restorehome: https://github.com/RostislavDugin/postgresus-maintainers:- - name: Alexander Gazal- email: [email protected]diff --git a/deploy/postgresus/README.md b/deploy/postgresus/README.mdnew file mode 100644index 00000000..2dd9c7dd--- /dev/null+++ b/deploy/postgresus/README.md@@ -0,0 +1,84 @@+# Postgresus Helm Chart++## Installation++```bash+helm install postgresus ./deploy/postgresus -n postgresus --create-namespace+```++## Configuration++### Main Parameters++| Parameter | Description | Default Value |+| ------------------ | ------------------ | --------------------------- |+| `namespace.create` | Create namespace | `true` |+| `namespace.name` | Namespace name | `postgresus` |+| `image.repository` | Docker image | `rostislavdugin/postgresus` |+| `image.tag` | Image tag | `latest` |+| `image.pullPolicy` | Image pull policy | `Always` |+| `replicaCount` | Number of replicas | `1` |++### Resources++| Parameter | Description | Default Value |+| --------------------------- | -------------- | ------------- |+| `resources.requests.memory` | Memory request | `1Gi` |+| `resources.requests.cpu` | CPU request | `500m` |+| `resources.limits.memory` | Memory limit | `1Gi` |+| `resources.limits.cpu` | CPU limit | `500m` |++### Storage++| Parameter | Description | Default Value |+| ------------------------------ | ------------------------- | ---------------------- |+| `persistence.enabled` | Enable persistent storage | `true` |+| `persistence.storageClassName` | Storage class | `""` (cluster default) |+| `persistence.accessMode` | Access mode | `ReadWriteOnce` |+| `persistence.size` | Storage size | `10Gi` |+| `persistence.mountPath` | Mount path | `/postgresus-data` |++### Service++| Parameter | Description | Default Value |+| -------------------------- | ----------------------- | ------------- |+| `service.type` | Service type | `ClusterIP` |+| `service.port` | Service port | `4005` |+| `service.targetPort` | Target port | `4005` |+| `service.headless.enabled` | Enable headless service | `true` |++### Ingress++| Parameter | Description | Default Value |+| ----------------------- | ----------------- | ------------------------ |+| `ingress.enabled` | Enable Ingress | `true` |+| `ingress.className` | Ingress class | `nginx` |+| `ingress.hosts[0].host` | Hostname | `postgresus.example.com` |+| `ingress.tls` | TLS configuration | See values.yaml |++### Health Checks++| Parameter | Description | Default Value |+| ------------------------ | ---------------------- | ------------- |+| `livenessProbe.enabled` | Enable liveness probe | `true` |+| `readinessProbe.enabled` | Enable readiness probe | `true` |++## Custom Ingress Example++```yaml+# custom-values.yaml+ingress:+ hosts:+ - host: backup.example.com+ paths:+ - path: /+ pathType: Prefix+ tls:+ - secretName: backup-example-com-tls+ hosts:+ - backup.example.com+```++```bash+helm install postgresus ./deploy/postgresus -n postgresus --create-namespace -f custom-values.yaml+```diff --git a/postgresus/templates/_helpers.tpl b/deploy/postgresus/helm/_helpers.tplsimilarity index 100%rename from postgresus/templates/_helpers.tplrename to deploy/postgresus/helm/_helpers.tpldiff --git a/postgresus/templates/ingress.yaml b/deploy/postgresus/helm/ingress.yamlsimilarity index 100%rename from postgresus/templates/ingress.yamlrename to deploy/postgresus/helm/ingress.yamldiff --git a/postgresus/templates/namespace.yaml b/deploy/postgresus/helm/namespace.yamlsimilarity index 100%rename from postgresus/templates/namespace.yamlrename to deploy/postgresus/helm/namespace.yamldiff --git a/postgresus/templates/service.yaml b/deploy/postgresus/helm/service.yamlsimilarity index 100%rename from postgresus/templates/service.yamlrename to deploy/postgresus/helm/service.yamldiff --git a/postgresus/templates/statefulset.yaml b/deploy/postgresus/helm/statefulset.yamlsimilarity index 97%rename from postgresus/templates/statefulset.yamlrename to deploy/postgresus/helm/statefulset.yamlindex 5281d45d..c5f982af 100644--- a/postgresus/templates/statefulset.yaml+++ b/deploy/postgresus/helm/statefulset.yaml@@ -71,7 +71,9 @@ spec:spec:accessModes:- {{ .Values.persistence.accessMode }}+ {{- if .Values.persistence.storageClassName }}storageClassName: {{ .Values.persistence.storageClassName }}+ {{- end }}resources:requests:storage: {{ .Values.persistence.size }}diff --git a/postgresus/values.yaml b/deploy/postgresus/values.yamlsimilarity index 84%rename from postgresus/values.yamlrename to deploy/postgresus/values.yamlindex d4358f75..ce470672 100644--- a/postgresus/values.yaml+++ b/deploy/postgresus/values.yaml@@ -8,8 +8,8 @@ namespace:# Image configurationimage:repository: rostislavdugin/postgresus- tag: v1.45.3- pullPolicy: IfNotPresent+ tag: latest+ pullPolicy: Always# StatefulSet configurationreplicaCount: 1@@ -26,8 +26,8 @@ service:# Resource limits and requestsresources:requests:- memory: "512Mi"- cpu: "250m"+ memory: "1Gi"+ cpu: "500m"limits:memory: "1Gi"cpu: "500m"@@ -35,7 +35,9 @@ resources:# Persistent storage configurationpersistence:enabled: true- storageClassName: longhorn-pg+ # Storage class name. Leave empty to use cluster default.+ # Examples: "longhorn", "standard", "gp2", etc.+ storageClassName: ""accessMode: ReadWriteOncesize: 10Gi# Mount path in container@@ -71,11 +73,12 @@ ingress:hosts:- postgresus.example.com-# Health checks configuration (commented out by default)+# Health checks configuration+# Note: The application only has /api/v1/system/health endpointlivenessProbe:- enabled: false+ enabled: truehttpGet:- path: /health+ path: /api/v1/system/healthport: 4005initialDelaySeconds: 30periodSeconds: 10@@ -83,11 +86,11 @@ livenessProbe:failureThreshold: 3readinessProbe:- enabled: false+ enabled: truehttpGet:- path: /ready+ path: /api/v1/system/healthport: 4005- initialDelaySeconds: 5+ initialDelaySeconds: 10periodSeconds: 5timeoutSeconds: 3failureThreshold: 3diff --git a/postgresus/README.md b/postgresus/README.mddeleted file mode 100644index 30341010..00000000--- a/postgresus/README.md+++ /dev/null@@ -1,189 +0,0 @@-# Postgresus Helm Chart--Helm chart for deploying Postgresus - a PostgreSQL backup and management system.--## Description--This Helm chart deploys Postgresus in a Kubernetes cluster using StatefulSet to ensure persistent data storage.--## Installation--### Install with Default Values--```bash-helm install postgresus ./helm-chart/postgresus -n postgresus --create-namespace-```--### Install with Custom Values--```bash-helm install postgresus ./helm-chart/postgresus -n postgresus --create-namespace -f custom-values.yaml-```--### Upgrade Release--```bash-helm upgrade postgresus ./helm-chart/postgresus -n postgresus-```--### Uninstall Release--```bash-helm uninstall postgresus -n postgresus-```--## Configuration--### Main Parameters--| Parameter | Description | Default Value |-|----------|----------|----------------------|-| `namespace.create` | Create namespace | `true` |-| `namespace.name` | Namespace name | `postgresus` |-| `image.repository` | Docker image | `rostislavdugin/postgresus` |-| `image.tag` | Image tag | `v1.34.0` |-| `image.pullPolicy` | Image pull policy | `IfNotPresent` |-| `replicaCount` | Number of replicas | `1` |--### Resources--| Parameter | Description | Default Value |-|----------|----------|----------------------|-| `resources.requests.memory` | Memory request | `512Mi` |-| `resources.requests.cpu` | CPU request | `250m` |-| `resources.limits.memory` | Memory limit | `1Gi` |-| `resources.limits.cpu` | CPU limit | `500m` |--### Storage--| Parameter | Description | Default Value |-|----------|----------|----------------------|-| `persistence.enabled` | Enable persistent storage | `true` |-| `persistence.storageClassName` | Storage class | `longhorn` |-| `persistence.accessMode` | Access mode | `ReadWriteOnce` |-| `persistence.size` | Storage size | `10Gi` |-| `persistence.mountPath` | Mount path | `/postgresus-data` |--### Service--| Parameter | Description | Default Value |-|----------|----------|----------------------|-| `service.type` | Service type | `ClusterIP` |-| `service.port` | Service port | `4005` |-| `service.targetPort` | Target port | `4005` |-| `service.headless.enabled` | Enable headless service | `true` |--### Ingress--| Parameter | Description | Default Value |-|----------|----------|----------------------|-| `ingress.enabled` | Enable Ingress | `true` |-| `ingress.className` | Ingress class | `nginx` |-| `ingress.hosts[0].host` | Hostname | `postgresus.home.fwz.ru` |-| `ingress.tls` | TLS configuration | See values.yaml |--### Health Checks--| Parameter | Description | Default Value |-|----------|----------|----------------------|-| `livenessProbe.enabled` | Enable liveness probe | `false` |-| `readinessProbe.enabled` | Enable readiness probe | `false` |--## Usage Examples--### Change Image Version--```yaml-# custom-values.yaml-image:- tag: v1.20.0-```--```bash-helm upgrade postgresus ./helm-chart/postgresus -n postgresus -f custom-values.yaml-```--### Change Storage Size--```yaml-# custom-values.yaml-persistence:- size: 50Gi-```--### Configure Ingress for Different Domain--```yaml-# custom-values.yaml-ingress:- hosts:- - host: backup.example.com- paths:- - path: /- pathType: Prefix- tls:- - secretName: backup-example-com-tls- hosts:- - backup.example.com-```--### Enable Health Checks--```yaml-# custom-values.yaml-livenessProbe:- enabled: true--readinessProbe:- enabled: true-```--## Verify Deployment--```bash-# Check release status-helm status postgresus -n postgresus--# View pods-kubectl get pods -n postgresus--# View services-kubectl get svc -n postgresus--# View ingress-kubectl get ingress -n postgresus--# View PVC-kubectl get pvc -n postgresus-```--## Debugging--```bash-# View logs-kubectl logs -n postgresus -l app=postgresus--# View events-kubectl get events -n postgresus--# Describe StatefulSet-kubectl describe statefulset postgresus -n postgresus--# Render templates without installation-helm template postgresus ./helm-chart/postgresus -n postgresus-```--## Requirements--- Kubernetes 1.19+-- Helm 3.0+-- PV provisioner (e.g., Longhorn)-- Nginx Ingress Controller (optional)-- Cert-Manager (optional, for automatic certificates)--## Notes--- The chart uses StatefulSet to ensure stable data storage-- Headless service is created automatically for StatefulSet-- By default, one application instance is created (replica=1)-- It's recommended to configure a backup policy for PVC