96 lines
2.5 KiB
YAML
96 lines
2.5 KiB
YAML
# PostgreSQL (Production) Helm Values
|
|
# Chart: https://github.com/bitnami/charts/tree/main/bitnami/postgresql
|
|
# Architecture: Primary + 2 Read Replicas with streaming replication
|
|
|
|
fullnameOverride: postgresql
|
|
|
|
# Use latest tag (ARM64 compatible)
|
|
image:
|
|
tag: latest
|
|
|
|
architecture: replication
|
|
|
|
auth:
|
|
existingSecret: postgresql-password
|
|
secretKeys:
|
|
adminPasswordKey: postgres-password
|
|
userPasswordKey: password
|
|
replicationPasswordKey: replication-password
|
|
username: bluemayne
|
|
database: postgres
|
|
|
|
primary:
|
|
persistence:
|
|
enabled: true
|
|
size: 20Gi
|
|
storageClass: local-path
|
|
|
|
# PostgreSQL configuration
|
|
extendedConfiguration: |
|
|
max_connections = 200
|
|
shared_buffers = 256MB
|
|
effective_cache_size = 1GB
|
|
maintenance_work_mem = 64MB
|
|
checkpoint_completion_target = 0.9
|
|
wal_buffers = 16MB
|
|
default_statistics_target = 100
|
|
random_page_cost = 1.1
|
|
effective_io_concurrency = 200
|
|
work_mem = 1310kB
|
|
min_wal_size = 1GB
|
|
max_wal_size = 4GB
|
|
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "30m" # Reduced to 30% of original (100m -> 30m)
|
|
|
|
readReplicas:
|
|
replicaCount: 2
|
|
persistence:
|
|
enabled: true
|
|
size: 20Gi
|
|
storageClass: local-path
|
|
|
|
# PostgreSQL configuration (must match primary for replication)
|
|
extendedConfiguration: |
|
|
max_connections = 200
|
|
shared_buffers = 256MB
|
|
effective_cache_size = 1GB
|
|
maintenance_work_mem = 64MB
|
|
checkpoint_completion_target = 0.9
|
|
wal_buffers = 16MB
|
|
default_statistics_target = 100
|
|
random_page_cost = 1.1
|
|
effective_io_concurrency = 200
|
|
work_mem = 1310kB
|
|
min_wal_size = 1GB
|
|
max_wal_size = 4GB
|
|
|
|
# Force read replicas to different nodes for better availability
|
|
# Avoid scheduling on the same node as primary or other read replicas
|
|
affinity:
|
|
podAntiAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: read
|
|
app.kubernetes.io/instance: postgresql
|
|
app.kubernetes.io/name: postgresql
|
|
topologyKey: kubernetes.io/hostname
|
|
- labelSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: primary
|
|
app.kubernetes.io/instance: postgresql
|
|
app.kubernetes.io/name: postgresql
|
|
topologyKey: kubernetes.io/hostname
|
|
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "30m" # Reduced to 30% of original (100m -> 30m)
|
|
|
|
# Metrics for Prometheus (disabled due to ARM64 compatibility)
|
|
metrics:
|
|
enabled: false
|