部署一个示例
[root@master 08-argo-rollouts]# kubectl apply -f 05-argo-rollouts-bluegreen-demo.yaml
rollout.argoproj.io/rollout-helloworld-bluegreen configured
service/spring-boot-helloworld unchanged
service/spring-boot-helloworld-preview unchanged
[root@master 08-argo-rollouts]# cat 05-argo-rollouts-bluegreen-demo.yaml
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollout-helloworld-bluegreen
spec:
replicas: 3
revisionHistoryLimit: 5
selector:
matchLabels:
app: rollout-helloworld-bluegreen
template:
metadata:
labels:
app: rollout-helloworld-bluegreen
spec:
containers:
- name: spring-boot-helloworld
image: ikubernetes/spring-boot-helloworld:v0.9.2
ports:
- containerPort: 80
strategy:
blueGreen:
activeService: spring-boot-helloworld
previewService: spring-boot-helloworld-preview
autoPromotionEnabled: false
---
kind: Service
apiVersion: v1
metadata:
name: spring-boot-helloworld
spec:
selector:
app: rollout-helloworld-bluegreen
ports:
- protocol: TCP
port: 80
targetPort: 80
---
kind: Service
apiVersion: v1
metadata:
name: spring-boot-helloworld-preview
spec:
selector:
app: rollout-helloworld-bluegreen
ports:
- protocol: TCP
port: 80
targetPort: 80
更新一下镜像版本
[root@master 08-argo-rollouts]# vim 05-argo-rollouts-bluegreen-demo.yaml
spec:
containers:
- name: spring-boot-helloworld
image: ikubernetes/spring-boot-helloworld:v0.9.3
ports:
- containerPort: 80
[root@master 08-argo-rollouts]# kubectl apply -f 05-argo-rollouts-bluegreen-demo.yaml
也可以回滚
版本又变成了0.9.2
标签:rollouts,spring,boot,helloworld,bluegreen,更新,rollout From: https://www.cnblogs.com/zyyang1993/p/16889928.html