更新 deployment-temp.yml
Some checks failed
Build Push and Deploy Image / build (push) Failing after 12m22s
Some checks failed
Build Push and Deploy Image / build (push) Failing after 12m22s
This commit is contained in:
70
deployment-temp.yml
Normal file
70
deployment-temp.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: $APP_NAME
|
||||
version: $APP_TAG
|
||||
name: $APP_NAME
|
||||
namespace: dl-proj #一定要写名称空间
|
||||
spec:
|
||||
progressDeadlineSeconds: 600
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: $APP_NAME
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 50%
|
||||
maxUnavailable: 50%
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: $APP_NAME
|
||||
version: $APP_TAG
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: dockerhub-id #提前在项目下配置访问阿里云的账号密码
|
||||
containers:
|
||||
- image: $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$APP_TAG
|
||||
name: $APP_NAME
|
||||
imagePullPolicy: Always
|
||||
livenessProbe: # 存活探针:失败意味着应用彻底挂了,需要重启来恢复
|
||||
httpGet:
|
||||
path: /test
|
||||
port: 9090
|
||||
initialDelaySeconds: 10 # 延迟xx秒开始执行
|
||||
periodSeconds: 15 # 每隔15秒执行一次
|
||||
timeoutSeconds: 10 # 10秒未返回结果则超时
|
||||
failureThreshold: 10 # 探测失败后的重试次数,当达到这个次数后就判定结果为失败
|
||||
# successThreshold: 5
|
||||
ports:
|
||||
- containerPort: 13145
|
||||
protocol: TCP
|
||||
resources:
|
||||
limits:
|
||||
cpu: 99m
|
||||
memory: 65Mi
|
||||
env:
|
||||
- name: TZ
|
||||
value: "Asia/Shanghai"
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: $APP_NAME
|
||||
name: $APP_NAME
|
||||
namespace: dl-proj
|
||||
spec:
|
||||
type: NodePort
|
||||
externalTrafficPolicy: Local
|
||||
ports:
|
||||
- name: http
|
||||
protocol: TCP
|
||||
port: 13145
|
||||
nodePort: 13145
|
||||
selector:
|
||||
app: $APP_NAME
|
||||
Reference in New Issue
Block a user