RAM Kubernetes Setup
Complete guide to deploying RAM PostgreSQL clustering solution on Kubernetes for production environments
Prerequisites
Kubernetes Requirements
- Kubernetes 1.20+ cluster
- kubectl configured and authenticated
- Helm 3.0+ installed
- Storage class configured
- LoadBalancer or Ingress controller
Resource Requirements
- 3+ worker nodes for high availability
- 4GB+ RAM per node
- 2+ CPU cores per node
- 50GB+ storage per node
Helm Installation
1. Add Helm Repository
# Add pgElephant Helm repository
helm repo add pgelephant https://charts.pgelephant.com
helm repo update
# Search available charts
helm search repo pgelephant/ram
2. Create Namespace
# Create dedicated namespace
kubectl create namespace ram-cluster
# Set as default namespace
kubectl config set-context --current --namespace=ram-cluster
3. Install RAM Cluster
# Install with default values
helm install ram-cluster pgelephant/ram \
--namespace ram-cluster \
--set cluster.name=production-cluster \
--set cluster.nodeCount=3 \
--set postgresql.auth.postgresPassword=secure-password
# Check installation status
helm status ram-cluster -n ram-cluster
kubectl get pods -n ram-cluster
Custom Configuration
values.yaml Configuration
# values.yaml
cluster:
name: "production-cluster"
nodeCount: 3
postgresql:
auth:
postgresPassword: "secure-password"
primary:
persistence:
size: 50Gi
storageClass: "fast-ssd"
ramd:
replicaCount: 3
service:
type: LoadBalancer
port: 8080
monitoring:
prometheus:
enabled: true
grafana:
enabled: true
adminPassword: "admin-password"
Install with Custom Values
# Install with custom configuration
helm install ram-cluster pgelephant/ram \
--namespace ram-cluster \
--values values.yaml
# Check installation status
helm status ram-cluster -n ram-cluster
kubectl get pods -n ram-cluster
Monitoring Setup
Access Monitoring Services
# Get service URLs
kubectl get svc -n ram-cluster
# Port forward for local access
kubectl port-forward -n ram-cluster svc/ram-cluster-ramd 8080:8080
kubectl port-forward -n ram-cluster svc/ram-cluster-prometheus 9090:9090
kubectl port-forward -n ram-cluster svc/ram-cluster-grafana 3000:3000
# Access services
# RAM API: http://localhost:8080/health
# Prometheus: http://localhost:9090
# Grafana: http://localhost:3000
Production Deployment
High Availability
- Deploy across multiple availability zones
- Use anti-affinity rules for pod distribution
- Configure pod disruption budgets
- Implement health checks and readiness probes
- Use persistent volumes with replication
- Set up automated backups
Security
- Use Kubernetes secrets for passwords
- Enable RBAC and network policies
- Use TLS certificates for encryption
- Implement pod security standards
- Regular security scanning
- Audit logging enabled
Troubleshooting
Common Issues
Pods not starting
# Check pod status
kubectl describe pod -n ram-cluster
# Check logs
kubectl logs -n ram-cluster -l app=postgresql
# Check persistent volumes
kubectl get pv,pvc -n ram-cluster
# Check storage class
kubectl get storageclass
Storage issues
- • Check persistent volume claims (PVC)
- • Verify storage class configuration
- • Ensure sufficient storage capacity
- • Check node disk space
- • Verify storage permissions
What's Next?
Cluster Management
Learn advanced cluster operations and maintenance
Advanced Monitoring
Set up comprehensive monitoring and alerting
Security Hardening
Implement enterprise security and compliance