81 lines
2.2 KiB
YAML
81 lines
2.2 KiB
YAML
|
|
# ----------------------------
|
|||
|
|
# Deployment
|
|||
|
|
# ----------------------------
|
|||
|
|
apiVersion: apps/v1
|
|||
|
|
kind: Deployment
|
|||
|
|
metadata:
|
|||
|
|
name: test-lessie-ai-web-deployment
|
|||
|
|
namespace: test-lessie
|
|||
|
|
labels:
|
|||
|
|
app: test-lessie-ai-web
|
|||
|
|
environment: test
|
|||
|
|
project: lessie
|
|||
|
|
spec:
|
|||
|
|
replicas: 1
|
|||
|
|
selector:
|
|||
|
|
matchLabels:
|
|||
|
|
app: test-lessie-ai-web
|
|||
|
|
environment: test
|
|||
|
|
project: lessie
|
|||
|
|
strategy:
|
|||
|
|
type: RollingUpdate # 滚动更新策略
|
|||
|
|
rollingUpdate:
|
|||
|
|
maxSurge: 1 # 最大新增副本数(先加)
|
|||
|
|
maxUnavailable: 0 # 最大不可用副本数(不减)
|
|||
|
|
template:
|
|||
|
|
metadata:
|
|||
|
|
labels:
|
|||
|
|
app: test-lessie-ai-web
|
|||
|
|
environment: test
|
|||
|
|
project: lessie
|
|||
|
|
spec:
|
|||
|
|
imagePullSecrets:
|
|||
|
|
- name: dxin-image-repository
|
|||
|
|
volumes:
|
|||
|
|
- name: test-default-conf-volume
|
|||
|
|
configMap:
|
|||
|
|
name: test-default-conf
|
|||
|
|
containers:
|
|||
|
|
- name: test-lessie-ai-web
|
|||
|
|
image: uswccr.ccs.tencentyun.com/lessiesit/lessie-ai-web:latest
|
|||
|
|
imagePullPolicy: IfNotPresent
|
|||
|
|
ports:
|
|||
|
|
- containerPort: 80
|
|||
|
|
resources:
|
|||
|
|
requests:
|
|||
|
|
cpu: "200m" # 容器请求分配0.2个CPU核心(这不是实际占用,但调度会以这里进行参考)
|
|||
|
|
memory: "256Mi" # 容器请求分配1Gi内存(这会实际预留)
|
|||
|
|
limits:
|
|||
|
|
cpu: "500m" # 最多可以使用0.5个CPU核心
|
|||
|
|
memory: "512Mi" # 容器最多可以使用8Gi内存
|
|||
|
|
volumeMounts:
|
|||
|
|
- name: test-default-conf-volume
|
|||
|
|
mountPath: /etc/nginx/conf.d/default.conf
|
|||
|
|
subPath: default.conf
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
# ----------------------------
|
|||
|
|
# Service
|
|||
|
|
# 集群内部:http://test-lessie-ai-web-svc.test-lessie.svc.cluster.local:8000
|
|||
|
|
# 集群外部:http://<Node_IP>:30080
|
|||
|
|
# ----------------------------
|
|||
|
|
apiVersion: v1
|
|||
|
|
kind: Service
|
|||
|
|
metadata:
|
|||
|
|
name: test-lessie-ai-web-svc
|
|||
|
|
namespace: test-lessie
|
|||
|
|
labels:
|
|||
|
|
app: test-lessie-ai-web
|
|||
|
|
environment: test
|
|||
|
|
project: lessie
|
|||
|
|
spec:
|
|||
|
|
type: NodePort
|
|||
|
|
selector:
|
|||
|
|
app: test-lessie-ai-web
|
|||
|
|
environment: test
|
|||
|
|
project: lessie
|
|||
|
|
ports:
|
|||
|
|
- name: http
|
|||
|
|
port: 80
|
|||
|
|
targetPort: 80
|
|||
|
|
nodePort: 30080
|