Update Node.js deployment with resource limits for k3s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user