Search⌘ K
AI Features

Exploring Argo Rollouts Definitions

Explore how to work with Argo Rollouts definitions to implement progressive delivery in Kubernetes. Understand the use of Rollout, AnalysisTemplate, and Service resources within Helm templates, the canary and blue-green deployment strategies, and how to configure traffic routing using Istio's VirtualService. Gain insight into automating deployment processes and managing traffic shifts during rollouts.

We'll continue using the devops-toolkit application that we've used before.

Just like before, the entire application definition is in the helm directory. It contains the templates of all the definitions that we’ll need, as well as a few that we’ll ignore given that they're used in other examples. Everything directly related to Argo Rollouts is in the rollout.yaml file, so let's look at it first.

Note: While it might be easier to explore Argo Rollouts through “pure” Kubernetes YAML, we believe that it's better to use Helm templates because they allow us to apply different variations of the strategies by changing a few values instead of creating new definitions.

The output, limited to the relevant parts, is as follows.

YAML
{{- if .Values.rollout.enabled }}
---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
...
spec:
...
strategy:
canary:
canaryService: {{ template "fullname" . }}-canary
stableService: {{ template "fullname" . }}
trafficRouting:
istio:
virtualService:
name: {{ template "fullname" . }}
routes:
- primary
steps:
{{ toYaml .Values.rollout.steps | indent 6 }}
{{- if .Values.rollout.analysis.enabled }}
...
{{- end }}
{{- if .Values.rollout.analysis.enabled }}
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
...
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}-canary
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
app: {{ template "fullname" . }}
{{- end }}

Definitions in the file

There are three kinds of definitions in that file. We have the Rollout, the AnalysisTemplate, and the Service:

  • The Rollout is almost the same definition as what we’d expect from a Kubernetes Deployment. As a matter of fact, everything that we can define as a Deployment ...