From d8fe9337bb8634d709254f8735a7fc155d636156 Mon Sep 17 00:00:00 2001 From: Unchained Date: Fri, 6 Mar 2026 19:34:29 +0200 Subject: [PATCH] Update Node.js deployment with resource limits for k3s --- k8s/deployment-nodejs.yaml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/k8s/deployment-nodejs.yaml b/k8s/deployment-nodejs.yaml index 85c9a70..26e7b84 100644 --- a/k8s/deployment-nodejs.yaml +++ b/k8s/deployment-nodejs.yaml @@ -2,7 +2,8 @@ apiVersion: v1 kind: Secret metadata: name: woocommerce-credentials - namespace: manoonoilstype: Opaque + namespace: manoonoils +type: Opaque stringData: WOOCOMMERCE_URL: "https://manoonoils.com" # You'll need to update these with actual credentials @@ -13,7 +14,8 @@ apiVersion: apps/v1 kind: Deployment metadata: name: storefront - namespace: manoonoilsspec: + namespace: manoonoils +spec: replicas: 1 selector: matchLabels: @@ -33,10 +35,9 @@ metadata: set -e apk add --no-cache git - # Clone from Gitea (using HTTP with ssl verify disabled for self-signed cert) - git config --global http.sslVerify false + # Clone from Gitea (HTTP on port 3000) git clone --depth 1 --branch master \ - https://100.74.155.73:3000/unchained/manoon-headless.git \ + http://gitea.gitea.svc.cluster.local:3000/unchained/manoon-headless.git \ /workspace echo "Clone complete. Files:" @@ -47,7 +48,7 @@ metadata: securityContext: runAsUser: 0 - name: install - image: node:20-alpine + image: node:20-slim workingDir: /workspace command: - sh @@ -62,8 +63,12 @@ metadata: mountPath: /workspace securityContext: runAsUser: 0 + resources: + limits: + cpu: 2000m + memory: 2Gi - name: build - image: node:20-alpine + image: node:20-slim workingDir: /workspace command: - sh @@ -100,14 +105,14 @@ metadata: runAsUser: 0 resources: limits: - cpu: 2000m - memory: 2Gi + cpu: 1000m + memory: 1500Mi requests: - cpu: 500m + cpu: 250m memory: 512Mi containers: - name: storefront - image: node:20-alpine + image: node:20-slim workingDir: /workspace command: - npm