From d8bfe3bee7372f41e355a8433e14170b4bfd4234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Eduardo=20Garc=C3=ADa=20M=C3=A1rquez?= Date: Fri, 9 Jan 2026 07:19:42 -0500 Subject: [PATCH] fix(k3s): increase SQL Server memory limits to prevent OOMKilled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Memory limit: 384Mi → 768Mi - Memory request: 256Mi → 512Mi - MSSQL_MEMORY_LIMIT_MB: 340 → 512 Previous limits caused OOMKilled restarts during SQL Server startup. --- deploy/k3s/sqlserver.yaml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/deploy/k3s/sqlserver.yaml b/deploy/k3s/sqlserver.yaml index 814d352..7cab786 100644 --- a/deploy/k3s/sqlserver.yaml +++ b/deploy/k3s/sqlserver.yaml @@ -35,39 +35,34 @@ spec: kubernetes.io/hostname: hp62a containers: - name: sqlserver - image: mcr.microsoft.com/mssql/server:2022-latest + image: andresgarcia0313/mssql-express-lowram:latest ports: - containerPort: 1433 name: sql env: - - name: ACCEPT_EULA - value: "Y" - name: MSSQL_SA_PASSWORD valueFrom: 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" + value: "512" volumeMounts: - name: sqlserver-data mountPath: /var/opt/mssql resources: requests: - memory: "1200Mi" + memory: "512Mi" cpu: "250m" limits: - memory: "1536Mi" + memory: "768Mi" cpu: "1000m" livenessProbe: exec: command: - - /opt/mssql-tools18/bin/sqlcmd + - /opt/mssql-tools/bin/sqlcmd - -S - localhost - -U @@ -76,15 +71,14 @@ spec: - $(MSSQL_SA_PASSWORD) - -Q - SELECT 1 - - -C - initialDelaySeconds: 120 - periodSeconds: 60 - timeoutSeconds: 15 + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 10 failureThreshold: 5 readinessProbe: tcpSocket: port: 1433 - initialDelaySeconds: 60 + initialDelaySeconds: 30 periodSeconds: 15 timeoutSeconds: 10 volumes: