Files
dailyLove/deploy.yaml

75 lines
1.7 KiB
YAML
Raw Normal View History

2023-11-23 12:59:54 +08:00
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
2023-11-23 14:54:22 +08:00
app: dailylove
name: dailylove
2023-11-23 14:55:43 +08:00
namespace: my-proj #一定要写名称空间
2023-11-23 12:59:54 +08:00
spec:
progressDeadlineSeconds: 600
replicas: 1
selector:
matchLabels:
2023-11-23 14:54:22 +08:00
app: dailylove
2023-11-23 12:59:54 +08:00
strategy:
rollingUpdate:
maxSurge: 50%
maxUnavailable: 50%
type: RollingUpdate
template:
metadata:
labels:
2023-11-23 14:54:22 +08:00
app: dailylove
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:03:54 +08:00
path: /
2023-11-23 12:59:54 +08:00
port: 8080
timeoutSeconds: 10
failureThreshold: 30
periodSeconds: 5
imagePullPolicy: Always
name: app
ports:
- containerPort: 13145
protocol: TCP
resources:
limits:
cpu: 300m
2023-11-23 15:03:54 +08:00
memory: 120Mi
2023-11-23 12:59:54 +08:00
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
labels:
2023-11-23 14:54:22 +08:00
app: dailylove
name: dailylove
2023-11-23 12:59:54 +08:00
namespace: my-proj
spec:
ports:
- name: http
port: 13146
protocol: TCP
targetPort: 13146
selector:
2023-11-23 14:54:22 +08:00
app: dailylove
2023-11-23 12:59:54 +08:00
sessionAffinity: None
type: ClusterIP
---
apiVersion: v1
kind: ServiceAccount
metadata:
2023-11-23 14:54:22 +08:00
name: dailylove # ServiceAccount的名字
2023-11-23 12:59:54 +08:00
namespace: my-proj # serviceaccount的namespace
labels:
2023-11-23 14:54:22 +08:00
app: dailylove #ServiceAccount的标签