chore(k8s): add production kubernetes manifests for pengzhan-dev namespace
Build and Push Docker Image / build (push) Successful in 1m5s
Build and Push Docker Image / build (push) Successful in 1m5s
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pengzhan-web
|
||||
namespace: pengzhan-dev
|
||||
labels:
|
||||
app: pengzhan-web
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 5
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 0
|
||||
selector:
|
||||
matchLabels:
|
||||
app: pengzhan-web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: pengzhan-web
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
fsGroupChangePolicy: "OnRootMismatch"
|
||||
initContainers:
|
||||
- name: init-content-perms
|
||||
image: busybox:1.36
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- |
|
||||
mkdir -p /app/content/data
|
||||
chown -R 1000:1000 /app/content || true
|
||||
volumeMounts:
|
||||
- name: content-data
|
||||
mountPath: /app/content
|
||||
containers:
|
||||
- name: pengzhan-web
|
||||
image: git.pengzhan.dev/haopengzhan/pengzhan.dev:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
name: http
|
||||
env:
|
||||
- name: NODE_ENV
|
||||
value: "production"
|
||||
- name: PORT
|
||||
value: "3000"
|
||||
- name: CONTENT_DIR
|
||||
value: "/app/content"
|
||||
- name: ADMIN_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: pengzhan-secrets
|
||||
key: ADMIN_SECRET
|
||||
volumeMounts:
|
||||
- name: content-data
|
||||
mountPath: /app/content
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 30
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 3000
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 2
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
volumes:
|
||||
- name: content-data
|
||||
persistentVolumeClaim:
|
||||
claimName: pengzhan-content-pvc
|
||||
Reference in New Issue
Block a user