chore: 移除 Jenkinsfile,新增 deploy/ 目录部署配置
- 移除不符合团队规范的 Jenkinsfile - 新增 deploy/deployment.yaml(SWR 镜像、副本数1、私有镜像拉取 secrets) - 新增 deploy/service.yaml(80 端口转发到容器 3000 端口) - 新增 deploy/ingress.yaml(域名 personal.virtheart.com,Traefik + cert-manager) - docker-compose.yml 改为使用 SWR 镜像,保证本地与生产一致 - README 更新部署说明
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
# =========================================================
|
||||
# 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
|
||||
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
|
||||
Reference in New Issue
Block a user