58 lines
1.2 KiB
YAML
58 lines
1.2 KiB
YAML
architecture: replicaset
|
|
replicaCount: ${ replicas }
|
|
|
|
commonAnnotations:
|
|
mongodb.com/timeouts: "true"
|
|
|
|
mongodb:
|
|
extraFlags:
|
|
- "--oplogSizeMB=10240"
|
|
- "--setParameter=electionTimeoutMillis=10000"
|
|
- "--setParameter=heartbeatIntervalMillis=2000"
|
|
- "--setParameter=catchUpTimeoutMillis=30000"
|
|
- "--setParameter=catchUpTakeoverDelayMillis=30000"
|
|
|
|
# More forgiving probe settings
|
|
readinessProbe:
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
successThreshold: 1
|
|
|
|
livenessProbe:
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 20
|
|
timeoutSeconds: 5
|
|
failureThreshold: 6
|
|
|
|
# Proper shutdown handling
|
|
terminationGracePeriodSeconds: 300
|
|
|
|
# Ensure pods are distributed across nodes
|
|
affinity:
|
|
podAntiAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: mongodb
|
|
topologyKey: kubernetes.io/hostname
|
|
|
|
auth:
|
|
enabled: true
|
|
existingSecret: mongodb-auth
|
|
|
|
%{ if length(usernames) > 0 }
|
|
usernames:
|
|
%{ for username in usernames ~}
|
|
- ${ username }
|
|
%{ endfor ~}
|
|
%{ endif }
|
|
|
|
%{ if length(databases) > 0 }
|
|
databases:
|
|
%{ for database in databases ~}
|
|
- ${ database }
|
|
%{ endfor ~}
|
|
%{ endif }
|