apiVersion: apps/v1
kind: Deployment
metadata:
name: projectname-deployment
spec:
replicas: 1
###更新:容器准备完成之后,延迟60s,配合strategy.maxUnavailable: 0时,可以忽略###
#minReadySeconds: 60
###600s之后如果还没有发布成功,就打上标签,不做任何操作,必须大于minReadySeconds###
#progressDeadlineSeconds: 600
strategy:
###升级方式,默认的方式###
type: RollingUpdate
###严格控制,每次升级一个pod,不可用状态为0个pod###
rollingUpdate:
###滚动升级时会先启动1个pod###
maxSurge: 1
###滚动升级时允许的最大不可用的pod个数###
maxUnavailable: 0
selector:
matchLabels:
app: projectname
template:
metadata:
annotations:
###修改值,用于deployment自动更新###
springrain.k8s.version: updateversion
###禁用istio自动注入sidecar###
#sidecar.istio.io/inject: "false"
labels:
app: projectname
version: v1
spec