fix(k8s): increase SQL Server memory to prevent OOMKilled

- Increase memory limit from 1Gi to 1.5Gi
- Increase MSSQL_MEMORY_LIMIT_MB from 768 to 1024
- Increase liveness probe initialDelaySeconds to 120
- Increase failureThreshold to 5 for more tolerance
- Increase readiness probe timeouts

Fixes DEF-001: SQL Server was crashing with Exit Code 137 (OOMKilled)
due to insufficient memory allocation for SQL Server 2022 Express.
This commit is contained in:
Andrés Eduardo García Márquez 2026-01-08 00:01:39 -05:00
parent eacace330d
commit bbeea1ae24
1 changed files with 32 additions and 10 deletions

View File

@ -10,7 +10,7 @@ spec:
storageClassName: local-path
resources:
requests:
storage: 5Gi
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
@ -31,6 +31,8 @@ spec:
labels:
app: sqlserver
spec:
nodeSelector:
kubernetes.io/hostname: hp62a
containers:
- name: sqlserver
image: mcr.microsoft.com/mssql/server:2022-latest
@ -45,26 +47,46 @@ spec:
secretKeyRef:
name: student-secrets
key: db-password
# SQL Server Express - Optimización RAM
- name: MSSQL_PID
value: "Express"
- name: MSSQL_MEMORY_LIMIT_MB
value: "1024"
- name: MSSQL_AGENT_ENABLED
value: "false"
volumeMounts:
- name: sqlserver-data
mountPath: /var/opt/mssql
resources:
requests:
memory: "1Gi"
cpu: "500m"
memory: "1.2Gi"
cpu: "250m"
limits:
memory: "2Gi"
memory: "1.5Gi"
cpu: "1000m"
livenessProbe:
tcpSocket:
port: 1433
initialDelaySeconds: 30
periodSeconds: 10
exec:
command:
- /opt/mssql-tools18/bin/sqlcmd
- -S
- localhost
- -U
- sa
- -P
- $(MSSQL_SA_PASSWORD)
- -Q
- SELECT 1
- -C
initialDelaySeconds: 120
periodSeconds: 60
timeoutSeconds: 15
failureThreshold: 5
readinessProbe:
tcpSocket:
port: 1433
initialDelaySeconds: 30
periodSeconds: 5
initialDelaySeconds: 60
periodSeconds: 15
timeoutSeconds: 10
volumes:
- name: sqlserver-data
persistentVolumeClaim: