Files
Keybard-Vagabond-Demo/manifests/infrastructure/postgresql/postgresql-service-alias.yaml
Michael DiLeo 7327d77dcd redaction (#1)
Add the redacted source file for demo purposes

Reviewed-on: https://source.michaeldileo.org/michael_dileo/Keybard-Vagabond-Demo/pulls/1
Co-authored-by: Michael DiLeo <michael_dileo@proton.me>
Co-committed-by: Michael DiLeo <michael_dileo@proton.me>
2025-12-24 13:40:47 +00:00

65 lines
1.4 KiB
YAML

---
# 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