179 lines
5.0 KiB
YAML
179 lines
5.0 KiB
YAML
---
|
|
# ── eCommerce Backend Service ──
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ecommerce-app
|
|
namespace: ecommerce
|
|
labels:
|
|
app: ecommerce-app
|
|
app.kubernetes.io/part-of: ecommerce
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 80
|
|
targetPort: 3000
|
|
protocol: TCP
|
|
name: http
|
|
selector:
|
|
app: ecommerce-app
|
|
|
|
---
|
|
# ── eCommerce Backend Deployment ──
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ecommerce-app
|
|
namespace: ecommerce
|
|
labels:
|
|
app: ecommerce-app
|
|
app.kubernetes.io/part-of: ecommerce
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: ecommerce-app
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 0
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ecommerce-app
|
|
spec:
|
|
containers:
|
|
- name: ecommerce-app
|
|
image: ecommerce-backend:latest # patched by kustomize overlay
|
|
ports:
|
|
- containerPort: 3000
|
|
name: http
|
|
envFrom:
|
|
- configMapRef:
|
|
name: ecommerce-config
|
|
env:
|
|
# ── Database ──
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: DATABASE_URL
|
|
- name: MONGODB_URI
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: MONGODB_URI
|
|
- name: REDIS_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: REDIS_URL
|
|
# ── JWT ──
|
|
- name: JWT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: JWT_SECRET
|
|
- name: JWT_EXPIRES_IN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: JWT_EXPIRES_IN
|
|
- name: JWT_REFRESH_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: JWT_REFRESH_SECRET
|
|
- name: JWT_REFRESH_EXPIRES_IN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: JWT_REFRESH_EXPIRES_IN
|
|
# ── AWS S3 / MinIO ──
|
|
- name: AWS_ACCESS_KEY_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: AWS_ACCESS_KEY_ID
|
|
- name: AWS_SECRET_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: AWS_SECRET_ACCESS_KEY
|
|
- name: AWS_REGION
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: AWS_REGION
|
|
- name: AWS_S3_BUCKET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: AWS_S3_BUCKET
|
|
- name: AWS_ENDPOINT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: AWS_ENDPOINT
|
|
# ── Email ──
|
|
- name: EMAIL_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: EMAIL_USER
|
|
- name: EMAIL_PASS
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: EMAIL_PASS
|
|
# ── Paytm ──
|
|
- name: PAYTM_MERCHANT_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: PAYTM_MERCHANT_ID
|
|
- name: PAYTM_MERCHANT_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: PAYTM_MERCHANT_KEY
|
|
- name: PAYTM_WEBSITE
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: PAYTM_WEBSITE
|
|
- name: PAYTM_HOST
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: PAYTM_HOST
|
|
- name: PAYTM_CALLBACK_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ecommerce-secrets
|
|
key: PAYTM_CALLBACK_URL
|
|
resources:
|
|
requests:
|
|
cpu: 250m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 1Gi
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 3000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 3000
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 15
|
|
timeoutSeconds: 5
|
|
failureThreshold: 5
|