Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions k8s/ROLLOUTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Argo Rollouts Setup
### Installation verification
```bash
kubectl argo rollouts version
```
```text
kubectl-argo-rollouts: v1.9.0+838d4e7
BuildDate: 2026-03-20T21:08:11Z
GitCommit: 838d4e792be666ec11bd0c80331e0c5511b5010e
GitTreeState: clean
GoVersion: go1.24.13
Compiler: gc
Platform: linux/amd64
```

### Dashboard access
![Dashboard](/k8s/screenshots/argo_rollout_dashboard.png)

## Canary Deployment
### Strategy configuration explained
The strategy gradually increases the weight of the new version (ratio). If I notice some issue, I have the chance to
abort the rollout.

### Step-by-step rollout progression (screenshots from dashboard)
![Steps](/k8s/screenshots/argo_rollout_steps.png)

Changed the tag to latest, paused at weight 20:

![20](/k8s/screenshots/argo_rollout_pause_20.png)

### Promotion and abort demonstration

Pressed abort:

![Abort](/k8s/screenshots/argo_rollout_aborted.png)

Pressing "Promote" would just eventually replace all pods with the "latest" pods.

## Blue-Green Deployment
### Strategy configuration explained
I added a new service with the "-preview" suffix (`roll-dinfochart-preview`). The strategy reflects that.

### Preview vs active service
They are identical in my configuration, but all are working.

### Promotion process
```bash
kubectl argo rollouts promote roll-dinfochart
```
```text
rollout 'roll-dinfochart' promoted
```

## Strategy Comparison
### When to use canary vs blue-green
Canary is useful when there are no resources to host twice as many containers, or it is fine to test the new version on
a subset of users in production.

Blue-green is useful when we need to launch a new version (tested) and switch the service to the new one with no
downtime because it immediately re-routes traffic to the new version.
60 changes: 60 additions & 0 deletions k8s/dinfochart/templates/rollout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: {{ include "dinfochart.fullname" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "dinfochart.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "dinfochart.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "dinfoservice-role"
vault.hashicorp.com/agent-inject-secret-config: "secret/data/myapp/config"
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
ports:
- containerPort: {{ .Values.service.port }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: app-config
mountPath: /config
readOnly: true
- name: data-volume
mountPath: /data
envFrom:
- configMapRef:
name: {{ include "dinfochart.fullname" . }}-env
volumes:
- name: app-config
configMap:
name: {{ include "dinfochart.fullname" . }}-config
- name: data-volume
persistentVolumeClaim:
claimName: {{ include "dinfochart.fullname" . }}-data
strategy:
blueGreen:
activeService: {{ include "dinfochart.fullname" . }}
previewService: {{ include "dinfochart.fullname" . }}-preview
autoPromotionEnabled: false # Manual promotion
# autoPromotionSeconds: 30 # Or auto-promote after 30s
14 changes: 14 additions & 0 deletions k8s/dinfochart/templates/service-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "dinfochart.fullname" . }}-preview
labels:
{{- include "dinfochart.labels" . | nindent 4 }}
spec:
type: NodePort
selector:
{{- include "dinfochart.selectorLabels" . | nindent 4 }}
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
Binary file added k8s/screenshots/argo_rollout_aborted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added k8s/screenshots/argo_rollout_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added k8s/screenshots/argo_rollout_pause_20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added k8s/screenshots/argo_rollout_steps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading