liveBook · Manning

Preview service

As explained in Platform Engineering on Kubernetes

A preview service is the Kubernetes Service that exposes the candidate revision for validation without receiving production traffic.

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

How Platform Engineering on Kubernetes covers it

How deep it goes
Explains configuration, selector updates, revision access, paused promotion, and manual promotion, without detailing Service internals.
Examples
Demonstrates notifications-service-green, revision 2, curl validation through /green/service/info, and rollout promotion.
What it assumes
Assumes Kubernetes Services and ReplicaSets, while showing their selector relationship through an Argo Rollouts definition.
What you can do after
Operate/configure a preview path, validate a new ReplicaSet, and manually promote it with Argo Rollouts.
How it connects
Connects Kubernetes Service selectors with Argo Rollouts, blue/green deployments, ReplicaSets, Ingress, and manual promotion.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Platform Engineering on Kubernetes. The section links point to the parts of the book it draws on.