82 lines
2.0 KiB
YAML
82 lines
2.0 KiB
YAML
# eCommerce Admin Panel — Deployment + NodePort Service
|
|
#
|
|
# BEFORE BUILDING THE IMAGE:
|
|
# VITE_API_URL is baked into the JS bundle at Docker build time.
|
|
# You MUST build the image with the real backend URL:
|
|
#
|
|
# docker build \
|
|
# --build-arg VITE_API_URL=http://<NODE_IP>:30300/api \
|
|
# --build-arg VITE_APP_NAME="VC E-Commerce Admin Panel" \
|
|
# -t ecommerce-admin-panel:latest \
|
|
# ./eCommerce-admin-panel
|
|
#
|
|
# BEFORE APPLYING:
|
|
# Set image: to your built image name.
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ecommerce-admin-panel
|
|
namespace: ecommerce
|
|
labels:
|
|
app: ecommerce-admin-panel
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: ecommerce-admin-panel
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 0
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ecommerce-admin-panel
|
|
spec:
|
|
containers:
|
|
- name: ecommerce-admin-panel
|
|
image: ecommerce-admin-panel:latest # <-- replace with your registry image
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 80
|
|
resources:
|
|
requests:
|
|
cpu: "50m"
|
|
memory: "64Mi"
|
|
limits:
|
|
cpu: "200m"
|
|
memory: "128Mi"
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 80
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
failureThreshold: 3
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 80
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 15
|
|
failureThreshold: 3
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ecommerce-admin-panel
|
|
namespace: ecommerce
|
|
labels:
|
|
app: ecommerce-admin-panel
|
|
spec:
|
|
type: NodePort
|
|
selector:
|
|
app: ecommerce-admin-panel
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
targetPort: 80
|
|
nodePort: 30801 # Access via http://<NODE_IP>:30801
|