Skip to content

Commit 6f507de

Browse files
authored
feat(blog): add managed PostgreSQL with synchronous replication post (#497)
## Summary Adds a how-to blog post covering deployment of managed PostgreSQL on Cozystack. ## What - New page bundle at `content/en/blog/2026-04-17-managed-postgresql-synchronous-replication/` - Walkthrough of deploying Postgres via the Dashboard Marketplace and via kubectl/HelmRelease - Covers replicas (2 async, 3 with quorum-based synchronous replication), `resourcesPreset`, storage sizing, connection credentials retrieval, and S3-compatible backups - Three screenshots (Marketplace, deployment form, Ready state) embedded via `{{< figure >}}` shortcode with a fixed 720px width so they do not stretch across the full content column ## Why Give operators a concise, self-contained entry point for standing up production-grade PostgreSQL with automatic failover on Cozystack, without wading through the full managed apps reference docs. Complements the existing PostgreSQL reference under `/docs/v1/applications/postgres/`. ## Preview Netlify deploy preview will render the post under `/blog/2026/04/managed-postgresql-synchronous-replication-without-the-ops-headache/`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a new blog post covering managed PostgreSQL deployment with optional synchronous replication, featuring step-by-step Dashboard instructions, GitOps-based kubectl deployment workflows, configurable replica counts and resource settings, and S3-compatible backup configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 72c3aa9 + 06c07fe commit 6f507de

4 files changed

Lines changed: 106 additions & 0 deletions

File tree

135 KB
Loading
184 KB
Loading
93.1 KB
Loading
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: "Managed PostgreSQL with Synchronous Replication — Without the Ops Headache"
3+
slug: managed-postgresql-synchronous-replication-without-the-ops-headache
4+
date: 2026-04-17
5+
author: "Timur Tukaev"
6+
description: "Deploy production-grade PostgreSQL with automatic failover and optional synchronous replication on your own hardware in two minutes using Cozystack."
7+
---
8+
9+
Setting up PostgreSQL with synchronous replication the hard way means Patroni configs, etcd clusters, pgBouncer, monitoring exporters, backup scripts, failover testing — easily a week of work before you even store a single row. And then you still need to maintain it. AWS RDS solves this but locks you into a cloud bill that grows faster than your data.
10+
11+
What if you could get managed PostgreSQL on your own hardware in two minutes?
12+
13+
## The solution: Cozystack Managed PostgreSQL
14+
15+
Cozystack uses the [CloudNativePG](https://cloudnative-pg.io/) operator under the hood — one of the most mature Kubernetes-native Postgres operators available. You get automatic failover, streaming replication, and optional quorum-based synchronous replication, all managed by the platform.
16+
17+
## Via Dashboard (the quick way)
18+
19+
1. Open the Cozystack dashboard at `https://dashboard.<your-domain>`.
20+
2. Navigate to the **Marketplace** and find **Postgres**.
21+
22+
{{< figure src="001_marketplace.png" alt="Cozystack dashboard Marketplace with the Postgres application" width="720" >}}
23+
24+
3. Click **Deploy** and fill in the form:
25+
- Enter a name (e.g., `app-postgres`).
26+
- Set replicas to `2` (primary + standby with async replication) or `3` (for synchronous replication with quorum).
27+
- Choose your `resourcesPreset` (nano, micro, small, medium, large).
28+
- Set storage size (e.g., `10Gi`).
29+
- Under PostgreSQL parameters, configure `max_connections` if needed.
30+
31+
{{< figure src="002_replicas.png" alt="Postgres deployment form with replicas and resources configured" width="720" >}}
32+
33+
4. Click **Deploy**. Within two minutes, you have a primary + replica setup with automatic failover.
34+
35+
{{< figure src="005_ready.png" alt="Deployed Postgres application reporting Ready state" width="720" >}}
36+
37+
## Via kubectl (the GitOps way)
38+
39+
```yaml
40+
apiVersion: helm.toolkit.fluxcd.io/v2
41+
kind: HelmRelease
42+
metadata:
43+
name: postgres-myapp
44+
namespace: tenant-team1
45+
spec:
46+
chart:
47+
spec:
48+
chart: postgres
49+
reconcileStrategy: Revision # Reconcile on chart version change
50+
sourceRef:
51+
kind: HelmRepository
52+
name: cozystack-apps
53+
namespace: cozy-public
54+
version: 0.10.0
55+
interval: 0s # Reconcile only on spec change, not periodically
56+
values:
57+
replicas: 3
58+
size: 10Gi
59+
resourcesPreset: small
60+
databases:
61+
production:
62+
roles:
63+
admin:
64+
- appuser
65+
users:
66+
appuser:
67+
password: "your-strong-password" # or omit this line to auto-generate
68+
external: false
69+
```
70+
71+
```bash
72+
kubectl apply -f postgres.yaml
73+
```
74+
75+
## Getting connection credentials
76+
77+
```bash
78+
# Primary (read-write)
79+
kubectl get svc -n tenant-team1 | grep postgres-myapp-rw
80+
81+
# Replica (read-only)
82+
kubectl get svc -n tenant-team1 | grep postgres-myapp-ro
83+
84+
# Password
85+
kubectl get secret -n tenant-team1 postgres-myapp-app \
86+
-o jsonpath='{.data.password}' | base64 --decode
87+
```
88+
89+
These service names are resolvable from any nested Kubernetes cluster in the same tenant — no external DNS or VPN needed.
90+
91+
## Backups
92+
93+
Enable S3-compatible backup storage by setting `backup.enabled: true` in the values. Recovery is a one-line config change pointing to the source cluster name and an optional RFC 3339 timestamp.
94+
95+
## Learn more
96+
97+
- [Managed PostgreSQL documentation](https://cozystack.io/docs/v1/applications/postgres/)
98+
- [Deploy Applications guide](https://cozystack.io/docs/v1/getting-started/deploy-app/)
99+
- [CloudNativePG operator](https://cloudnative-pg.io/docs/)
100+
101+
## Join the community
102+
103+
- [GitHub](https://github.com/cozystack/cozystack)
104+
- Telegram [group](https://t.me/cozystack)
105+
- Slack [group](https://kubernetes.slack.com/archives/C06L3CPRVN1) (get invite at [https://slack.kubernetes.io](https://slack.kubernetes.io))
106+
- [Community Meeting Calendar](https://calendar.google.com/calendar?cid=ZTQzZDIxZTVjOWI0NWE5NWYyOGM1ZDY0OWMyY2IxZTFmNDMzZTJlNjUzYjU2ZGJiZGE3NGNhMzA2ZjBkMGY2OEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t)

0 commit comments

Comments
 (0)