liveBook · Manning

Rollout resource

As explained in Platform Engineering on Kubernetes

A Rollout resource is an Argo Rollouts custom resource that declares an application version and the strategy for progressing it through deployment.

A Rollout resource is an Argo Rollouts custom resource that declares a PodSpec, replica count, and deployment strategy. Its controller manages Pods and ReplicaSets instead of a Kubernetes Deployment, while adding controlled progression through canary or blue/green releases. section 8.3.1 section 8.3.2

Configure rollout behavior through the resource specification:

  • Set spec.template and spec.replicas to define the application Pods. section 8.3.1
  • Use a canary strategy to shift traffic by weights, pausing either for manual intervention or for a specified duration. section 8.3.1
  • Use a blueGreen strategy with activeService and previewService; disable auto-promotion when manual approval is required. section 8.3.2
  • Inspect rollout status and ReplicaSets with kubectl or the Argo Rollouts kubectl plugin, then promote a paused rollout explicitly. section 8.3.1 section 8.3.2

Canary release

A notifications-service Rollout starts three replicas, sends 25% of traffic to the canary, pauses for intervention, then sends 75% and pauses for ten seconds. Updating the image creates a second ReplicaSet; promotion shifts traffic fully to it and scales the previous ReplicaSet to zero. section 8.3.1

Blue/green release

A notifications-service Rollout keeps production traffic on the active blue service while the green preview service receives the new revision. After inspection, promotion switches production traffic to green. section 8.3.2

Listing 8.11 Argo Rollouts resource definition
apiVersion: argoproj.io/v1alpha1
kind: Rollout                        #1
metadata:
  name: notifications-service-canary
spec:
  replicas: 3                        #2
  strategy:
    canary:                          #3
      steps:                         #4
      - setWeight: 25
      - pause: {}
      - setWeight: 75
      - pause: {duration: 10}
  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
          ...

Use the manifest to see how replicas, PodSpec fields, selectors, image, and canary steps combine in one Rollout resource. section 8.3.1

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 manifest to compare blue/green configuration, including activeService, previewService, and autoPromotionEnabled. section 8.3.2

How Platform Engineering on Kubernetes covers it

How deep it goes
Explains manifest fields, traffic steps, service selectors, ReplicaSets, inspection, image updates, pauses, and promotion commands.
Examples
Demonstrates notifications-service releases using canary weights, paused promotion, active and preview services, image updates, and curl responses.
What it assumes
Assumes a Kubernetes cluster, kubectl, and familiarity with Pods, ReplicaSets, Services, ingress, and Kubernetes resource manifests.
What you can do after
Operate/configure staged Kubernetes releases and promote revisions through kubectl or the Argo Rollouts Dashboard.
How it connects
Connects PodSpec, ReplicaSet, Kubernetes Service, ingress, canary deployment, blue/green deployment, kubectl, and Argo Rollouts Dashboard.

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.