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:
parent
eacace330d
commit
bbeea1ae24
|
|
@ -10,7 +10,7 @@ spec:
|
||||||
storageClassName: local-path
|
storageClassName: local-path
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 5Gi
|
storage: 2Gi
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
|
@ -31,6 +31,8 @@ spec:
|
||||||
labels:
|
labels:
|
||||||
app: sqlserver
|
app: sqlserver
|
||||||
spec:
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: hp62a
|
||||||
containers:
|
containers:
|
||||||
- name: sqlserver
|
- name: sqlserver
|
||||||
image: mcr.microsoft.com/mssql/server:2022-latest
|
image: mcr.microsoft.com/mssql/server:2022-latest
|
||||||
|
|
@ -45,26 +47,46 @@ spec:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: student-secrets
|
name: student-secrets
|
||||||
key: db-password
|
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:
|
volumeMounts:
|
||||||
- name: sqlserver-data
|
- name: sqlserver-data
|
||||||
mountPath: /var/opt/mssql
|
mountPath: /var/opt/mssql
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "1Gi"
|
memory: "1.2Gi"
|
||||||
cpu: "500m"
|
cpu: "250m"
|
||||||
limits:
|
limits:
|
||||||
memory: "2Gi"
|
memory: "1.5Gi"
|
||||||
cpu: "1000m"
|
cpu: "1000m"
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
tcpSocket:
|
exec:
|
||||||
port: 1433
|
command:
|
||||||
initialDelaySeconds: 30
|
- /opt/mssql-tools18/bin/sqlcmd
|
||||||
periodSeconds: 10
|
- -S
|
||||||
|
- localhost
|
||||||
|
- -U
|
||||||
|
- sa
|
||||||
|
- -P
|
||||||
|
- $(MSSQL_SA_PASSWORD)
|
||||||
|
- -Q
|
||||||
|
- SELECT 1
|
||||||
|
- -C
|
||||||
|
initialDelaySeconds: 120
|
||||||
|
periodSeconds: 60
|
||||||
|
timeoutSeconds: 15
|
||||||
|
failureThreshold: 5
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
tcpSocket:
|
tcpSocket:
|
||||||
port: 1433
|
port: 1433
|
||||||
initialDelaySeconds: 30
|
initialDelaySeconds: 60
|
||||||
periodSeconds: 5
|
periodSeconds: 15
|
||||||
|
timeoutSeconds: 10
|
||||||
volumes:
|
volumes:
|
||||||
- name: sqlserver-data
|
- name: sqlserver-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue