|
| 1 | +# Postgresus Helm Chart |
| 2 | + |
| 3 | +Helm chart for deploying Postgresus - a PostgreSQL backup and management system. |
| 4 | + |
| 5 | +## Description |
| 6 | + |
| 7 | +This Helm chart deploys Postgresus in a Kubernetes cluster using StatefulSet to ensure persistent data storage. |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +### Install with Default Values |
| 12 | + |
| 13 | +```bash |
| 14 | +helm install postgresus ./helm-chart/postgresus -n postgresus --create-namespace |
| 15 | +``` |
| 16 | + |
| 17 | +### Install with Custom Values |
| 18 | + |
| 19 | +```bash |
| 20 | +helm install postgresus ./helm-chart/postgresus -n postgresus --create-namespace -f custom-values.yaml |
| 21 | +``` |
| 22 | + |
| 23 | +### Upgrade Release |
| 24 | + |
| 25 | +```bash |
| 26 | +helm upgrade postgresus ./helm-chart/postgresus -n postgresus |
| 27 | +``` |
| 28 | + |
| 29 | +### Uninstall Release |
| 30 | + |
| 31 | +```bash |
| 32 | +helm uninstall postgresus -n postgresus |
| 33 | +``` |
| 34 | + |
| 35 | +## Configuration |
| 36 | + |
| 37 | +### Main Parameters |
| 38 | + |
| 39 | +| Parameter | Description | Default Value | |
| 40 | +|----------|----------|----------------------| |
| 41 | +| `namespace.create` | Create namespace | `true` | |
| 42 | +| `namespace.name` | Namespace name | `postgresus` | |
| 43 | +| `image.repository` | Docker image | `rostislavdugin/postgresus` | |
| 44 | +| `image.tag` | Image tag | `v1.34.0` | |
| 45 | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | |
| 46 | +| `replicaCount` | Number of replicas | `1` | |
| 47 | + |
| 48 | +### Resources |
| 49 | + |
| 50 | +| Parameter | Description | Default Value | |
| 51 | +|----------|----------|----------------------| |
| 52 | +| `resources.requests.memory` | Memory request | `512Mi` | |
| 53 | +| `resources.requests.cpu` | CPU request | `250m` | |
| 54 | +| `resources.limits.memory` | Memory limit | `1Gi` | |
| 55 | +| `resources.limits.cpu` | CPU limit | `500m` | |
| 56 | + |
| 57 | +### Storage |
| 58 | + |
| 59 | +| Parameter | Description | Default Value | |
| 60 | +|----------|----------|----------------------| |
| 61 | +| `persistence.enabled` | Enable persistent storage | `true` | |
| 62 | +| `persistence.storageClassName` | Storage class | `longhorn` | |
| 63 | +| `persistence.accessMode` | Access mode | `ReadWriteOnce` | |
| 64 | +| `persistence.size` | Storage size | `10Gi` | |
| 65 | +| `persistence.mountPath` | Mount path | `/postgresus-data` | |
| 66 | + |
| 67 | +### Service |
| 68 | + |
| 69 | +| Parameter | Description | Default Value | |
| 70 | +|----------|----------|----------------------| |
| 71 | +| `service.type` | Service type | `ClusterIP` | |
| 72 | +| `service.port` | Service port | `4005` | |
| 73 | +| `service.targetPort` | Target port | `4005` | |
| 74 | +| `service.headless.enabled` | Enable headless service | `true` | |
| 75 | + |
| 76 | +### Ingress |
| 77 | + |
| 78 | +| Parameter | Description | Default Value | |
| 79 | +|----------|----------|----------------------| |
| 80 | +| `ingress.enabled` | Enable Ingress | `true` | |
| 81 | +| `ingress.className` | Ingress class | `nginx` | |
| 82 | +| `ingress.hosts[0].host` | Hostname | `postgresus.home.fwz.ru` | |
| 83 | +| `ingress.tls` | TLS configuration | See values.yaml | |
| 84 | + |
| 85 | +### Health Checks |
| 86 | + |
| 87 | +| Parameter | Description | Default Value | |
| 88 | +|----------|----------|----------------------| |
| 89 | +| `livenessProbe.enabled` | Enable liveness probe | `false` | |
| 90 | +| `readinessProbe.enabled` | Enable readiness probe | `false` | |
| 91 | + |
| 92 | +## Usage Examples |
| 93 | + |
| 94 | +### Change Image Version |
| 95 | + |
| 96 | +```yaml |
| 97 | +# custom-values.yaml |
| 98 | +image: |
| 99 | + tag: v1.20.0 |
| 100 | +``` |
| 101 | +
|
| 102 | +```bash |
| 103 | +helm upgrade postgresus ./helm-chart/postgresus -n postgresus -f custom-values.yaml |
| 104 | +``` |
| 105 | + |
| 106 | +### Change Storage Size |
| 107 | + |
| 108 | +```yaml |
| 109 | +# custom-values.yaml |
| 110 | +persistence: |
| 111 | + size: 50Gi |
| 112 | +``` |
| 113 | +
|
| 114 | +### Configure Ingress for Different Domain |
| 115 | +
|
| 116 | +```yaml |
| 117 | +# custom-values.yaml |
| 118 | +ingress: |
| 119 | + hosts: |
| 120 | + - host: backup.example.com |
| 121 | + paths: |
| 122 | + - path: / |
| 123 | + pathType: Prefix |
| 124 | + tls: |
| 125 | + - secretName: backup-example-com-tls |
| 126 | + hosts: |
| 127 | + - backup.example.com |
| 128 | +``` |
| 129 | +
|
| 130 | +### Enable Health Checks |
| 131 | +
|
| 132 | +```yaml |
| 133 | +# custom-values.yaml |
| 134 | +livenessProbe: |
| 135 | + enabled: true |
| 136 | + |
| 137 | +readinessProbe: |
| 138 | + enabled: true |
| 139 | +``` |
| 140 | +
|
| 141 | +## Verify Deployment |
| 142 | +
|
| 143 | +```bash |
| 144 | +# Check release status |
| 145 | +helm status postgresus -n postgresus |
| 146 | + |
| 147 | +# View pods |
| 148 | +kubectl get pods -n postgresus |
| 149 | + |
| 150 | +# View services |
| 151 | +kubectl get svc -n postgresus |
| 152 | + |
| 153 | +# View ingress |
| 154 | +kubectl get ingress -n postgresus |
| 155 | + |
| 156 | +# View PVC |
| 157 | +kubectl get pvc -n postgresus |
| 158 | +``` |
| 159 | + |
| 160 | +## Debugging |
| 161 | + |
| 162 | +```bash |
| 163 | +# View logs |
| 164 | +kubectl logs -n postgresus -l app=postgresus |
| 165 | + |
| 166 | +# View events |
| 167 | +kubectl get events -n postgresus |
| 168 | + |
| 169 | +# Describe StatefulSet |
| 170 | +kubectl describe statefulset postgresus -n postgresus |
| 171 | + |
| 172 | +# Render templates without installation |
| 173 | +helm template postgresus ./helm-chart/postgresus -n postgresus |
| 174 | +``` |
| 175 | + |
| 176 | +## Requirements |
| 177 | + |
| 178 | +- Kubernetes 1.19+ |
| 179 | +- Helm 3.0+ |
| 180 | +- PV provisioner (e.g., Longhorn) |
| 181 | +- Nginx Ingress Controller (optional) |
| 182 | +- Cert-Manager (optional, for automatic certificates) |
| 183 | + |
| 184 | +## Notes |
| 185 | + |
| 186 | +- The chart uses StatefulSet to ensure stable data storage |
| 187 | +- Headless service is created automatically for StatefulSet |
| 188 | +- By default, one application instance is created (replica=1) |
| 189 | +- It's recommended to configure a backup policy for PVC |
0 commit comments