策略配置
策略配置
spec:
strategy:
type: Recreate行为验证
行为验证
kubectl patch deploy/web -p '{"spec":{"strategy":{"type":"Recreate"}}}'
kubectl set image deploy/web web=web:1.27.0
kubectl get pods -l app=web -w # 观察先缩到 0 再起新 PodRecreate 期间服务完全不可用;依赖独占资源(如某些数据库文件锁、单实例设备)的负载才选它。