Files
dailyLove/deploy.yaml

80 lines
1.8 KiB
YAML
Raw Normal View History

2023-11-23 12:59:54 +08:00
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
2023-11-23 15:08:12 +08:00
app: $APP_NAME
version: $TAG
name: $APP_NAME
2023-11-28 00:39:56 +08:00
namespace: dl-proj #一定要写名称空间
2023-11-23 12:59:54 +08:00
spec:
progressDeadlineSeconds: 600
replicas: 1
selector:
matchLabels:
2023-11-23 15:08:12 +08:00
app: $APP_NAME
2023-11-23 12:59:54 +08:00
strategy:
rollingUpdate:
maxSurge: 50%
maxUnavailable: 50%
type: RollingUpdate
template:
metadata:
labels:
2023-11-23 15:08:12 +08:00
app: $APP_NAME
version: $TAG
2023-11-23 12:59:54 +08:00
spec:
imagePullSecrets:
- name: aliyun-docker-hub #提前在项目下配置访问阿里云的账号密码
containers:
- image: $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG
readinessProbe:
httpGet:
2023-11-23 15:38:44 +08:00
path: /test
port: 13145
2023-11-23 12:59:54 +08:00
timeoutSeconds: 10
failureThreshold: 30
periodSeconds: 5
imagePullPolicy: Always
name: app
ports:
- containerPort: 13145
protocol: TCP
resources:
limits:
2023-11-28 00:55:23 +08:00
cpu: 99m
2023-11-30 23:25:26 +08:00
memory: 65Mi
2023-11-23 12:59:54 +08:00
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
2023-11-23 15:45:57 +08:00
env:
- name: TZ
value: "Asia/Shanghai"
2023-11-23 12:59:54 +08:00
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
labels:
2023-11-23 15:08:12 +08:00
app: $APP_NAME
name: $APP_NAME
2023-11-28 00:39:56 +08:00
namespace: dl-proj
2023-11-23 12:59:54 +08:00
spec:
ports:
- name: http
2023-11-28 00:39:56 +08:00
port: 13145
2023-11-23 12:59:54 +08:00
protocol: TCP
2023-11-28 00:39:56 +08:00
targetPort: 13145
2023-11-23 12:59:54 +08:00
selector:
2023-11-23 15:08:12 +08:00
app: $APP_NAME
2023-11-23 12:59:54 +08:00
sessionAffinity: None
type: ClusterIP
---
apiVersion: v1
kind: ServiceAccount
metadata:
2023-11-23 15:08:12 +08:00
name: $APP_NAME # ServiceAccount的名字
2023-11-28 00:39:56 +08:00
namespace: dl-proj # serviceaccount的namespace
2023-11-23 12:59:54 +08:00
labels:
2023-11-23 15:08:12 +08:00
app: $APP_NAME #ServiceAccount的标签