Update Node.js deployment with resource limits for k3s

This commit is contained in:
Unchained
2026-03-06 19:34:29 +02:00
parent ced136fb4d
commit d8fe9337bb

View File

@@ -2,7 +2,8 @@ apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: woocommerce-credentials name: woocommerce-credentials
namespace: manoonoilstype: Opaque namespace: manoonoils
type: Opaque
stringData: stringData:
WOOCOMMERCE_URL: "https://manoonoils.com" WOOCOMMERCE_URL: "https://manoonoils.com"
# You'll need to update these with actual credentials # You'll need to update these with actual credentials
@@ -13,7 +14,8 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: storefront name: storefront
namespace: manoonoilsspec: namespace: manoonoils
spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
@@ -33,10 +35,9 @@ metadata:
set -e set -e
apk add --no-cache git apk add --no-cache git
# Clone from Gitea (using HTTP with ssl verify disabled for self-signed cert) # Clone from Gitea (HTTP on port 3000)
git config --global http.sslVerify false
git clone --depth 1 --branch master \ 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 /workspace
echo "Clone complete. Files:" echo "Clone complete. Files:"
@@ -47,7 +48,7 @@ metadata:
securityContext: securityContext:
runAsUser: 0 runAsUser: 0
- name: install - name: install
image: node:20-alpine image: node:20-slim
workingDir: /workspace workingDir: /workspace
command: command:
- sh - sh
@@ -62,8 +63,12 @@ metadata:
mountPath: /workspace mountPath: /workspace
securityContext: securityContext:
runAsUser: 0 runAsUser: 0
resources:
limits:
cpu: 2000m
memory: 2Gi
- name: build - name: build
image: node:20-alpine image: node:20-slim
workingDir: /workspace workingDir: /workspace
command: command:
- sh - sh
@@ -100,14 +105,14 @@ metadata:
runAsUser: 0 runAsUser: 0
resources: resources:
limits: limits:
cpu: 2000m cpu: 1000m
memory: 2Gi memory: 1500Mi
requests: requests:
cpu: 500m cpu: 250m
memory: 512Mi memory: 512Mi
containers: containers:
- name: storefront - name: storefront
image: node:20-alpine image: node:20-slim
workingDir: /workspace workingDir: /workspace
command: command:
- npm - npm