72 lines
2.0 KiB
YAML
72 lines
2.0 KiB
YAML
# =========================================================
|
|
# Arcticnewone 生产部署 - Deployment
|
|
#
|
|
# 镜像: 华为云 SWR swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest
|
|
# 副本数: 1(团队规范)
|
|
#
|
|
# 私有镜像拉取说明:
|
|
# 集群中需预先创建 docker-registry 类型的 Secret(凭据从环境变量读取,不写入仓库):
|
|
# kubectl create secret docker-registry huawei-swr-secret \
|
|
# --docker-server="$SWR_REGISTRY" \
|
|
# --docker-username="$SWR_USERNAME" \
|
|
# --docker-password="$SWR_PASSWORD" \
|
|
# --dry-run=client -o yaml | kubectl apply -f -
|
|
# 详见 deploy/README.md
|
|
# =========================================================
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: arcticnewone
|
|
namespace: arcticnewone
|
|
labels:
|
|
app: arcticnewone
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: arcticnewone
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: arcticnewone
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: huawei-swr-secret
|
|
containers:
|
|
- name: arcticnewone
|
|
image: swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- name: http
|
|
containerPort: 3000
|
|
env:
|
|
- name: NODE_ENV
|
|
value: "production"
|
|
- name: HOST
|
|
value: "0.0.0.0"
|
|
- name: PORT
|
|
value: "3000"
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 512Mi
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 20
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|