add source code and readme

This commit is contained in:
2025-12-24 14:35:17 +01:00
parent 7c92e1e610
commit 74324d5a1b
331 changed files with 39272 additions and 1 deletions

View File

@@ -0,0 +1,64 @@
---
# Service alias for backward compatibility
# This creates "postgresql-shared-rw" service that points to the same endpoints as "postgres-shared-rw"
# During the disaster recovery, I got the name wrong and dropped 'sql'
apiVersion: v1
kind: Service
metadata:
name: postgresql-shared-rw
namespace: postgresql-system
labels:
app: postgresql-shared
cnpg.io/cluster: postgres-shared
cnpg.io/reload: ""
spec:
type: ClusterIP
ports:
- name: postgres
port: 5432
protocol: TCP
targetPort: 5432
selector:
cnpg.io/cluster: postgres-shared
cnpg.io/instanceRole: primary
---
# Read-only service alias
apiVersion: v1
kind: Service
metadata:
name: postgresql-shared-ro
namespace: postgresql-system
labels:
app: postgresql-shared
cnpg.io/cluster: postgres-shared
cnpg.io/reload: ""
spec:
type: ClusterIP
ports:
- name: postgres
port: 5432
protocol: TCP
targetPort: 5432
selector:
cnpg.io/cluster: postgres-shared
cnpg.io/instanceRole: replica
---
# Read load-balanced service alias
apiVersion: v1
kind: Service
metadata:
name: postgresql-shared-r
namespace: postgresql-system
labels:
app: postgresql-shared
cnpg.io/cluster: postgres-shared
cnpg.io/reload: ""
spec:
type: ClusterIP
ports:
- name: postgres
port: 5432
protocol: TCP
targetPort: 5432
selector:
cnpg.io/cluster: postgres-shared