538bbb7ecd
ns 跟 app 名解耦,workflow 加 NS env 不再 cube-$APP 拼。
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
apiVersion: apps/v1
|
||
kind: Deployment
|
||
metadata:
|
||
name: piano-sheet
|
||
namespace: cube-piano
|
||
labels:
|
||
app: piano-sheet
|
||
spec:
|
||
replicas: 1
|
||
strategy:
|
||
# PVC 是 RWO,rolling 上线时新旧 pod 抢 PVC 会卡住,直接 Recreate
|
||
type: Recreate
|
||
selector:
|
||
matchLabels:
|
||
app: piano-sheet
|
||
template:
|
||
metadata:
|
||
labels:
|
||
app: piano-sheet
|
||
spec:
|
||
imagePullSecrets:
|
||
- name: registry-creds
|
||
containers:
|
||
- name: piano-sheet
|
||
image: registry.famzheng.me/mochi/piano-sheet:latest
|
||
imagePullPolicy: IfNotPresent
|
||
ports:
|
||
- containerPort: 8080
|
||
name: http
|
||
env:
|
||
- name: DB_PATH
|
||
value: /data/app.db
|
||
readinessProbe:
|
||
httpGet:
|
||
path: /healthz
|
||
port: http
|
||
initialDelaySeconds: 1
|
||
periodSeconds: 5
|
||
livenessProbe:
|
||
httpGet:
|
||
path: /healthz
|
||
port: http
|
||
initialDelaySeconds: 5
|
||
periodSeconds: 15
|
||
resources:
|
||
requests:
|
||
cpu: 10m
|
||
memory: 32Mi
|
||
limits:
|
||
cpu: 500m
|
||
memory: 256Mi
|
||
volumeMounts:
|
||
- name: data
|
||
mountPath: /data
|
||
volumes:
|
||
- name: data
|
||
persistentVolumeClaim:
|
||
claimName: piano-sheet-data
|