A preview service is the Kubernetes Service that exposes a new candidate revision during an Argo Rollouts blue/green deployment. It allows validation before promotion to the stable service and does not receive production traffic. section 8.3.2
Argo Rollouts manages the preview service through:
- A Rollout blueGreen strategy naming both an activeService and a previewService. section 8.3.2
- Selectors that point the preview service to the new ReplicaSet by matching its pod-template hash. section 8.3.2
- A paused rollout when autoPromotionEnabled is false, allowing manual validation and promotion. section 8.3.2
Validate the green revision
A request to /green/service/info reaches revision 2 through the preview service and returns version 1.1.0. After validation, promote the rollout with kubectl argo rollouts promote notifications-service-bluegreen. section 8.3.2
Listing 8.20 Rollout defining a BlueGreen strategy
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: notifications-service-bluegreen
spec:
replicas: 2
revisionHistoryLimit: 2
selector:
matchLabels:
app: notifications-service
template:
metadata:
labels:
app: notifications-service
spec:
containers:
- name: notifications-service
image: salaboy/notifications-service-<HASH>:v1.0.0
env:
- name: KAFKA_URL
value: kafka.default.svc.cluster.local
..
strategy:
blueGreen:
activeService: notifications-service-blue
previewService: notifications-service-green
autoPromotionEnabled: false
Use the Rollout definition to see how activeService, previewService, and manual promotion are configured together. section 8.3.2
