Skip to content

Commit 6d24af2

Browse files
docs: improve advanced scenarios documentation (#96)
Signed-off-by: Kostis Kapelonis <kostis@codefresh.io>
1 parent a08b5fa commit 6d24af2

File tree

1 file changed

+58
-3
lines changed

1 file changed

+58
-3
lines changed

docs/features/advanced-deployments.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Advanced Deployment methods
22

33
Once you have the basic canary deployment in place, you can explore
4-
several other deployment scenarios with more flexible routing options
4+
several other deployment scenarios with more flexible routing options.
55

6-
## Pinning clients to a specific version
6+
## Scenario - pinning clients to a specific version
77

88
Sometimes you have some special clients (either humans or other services) which you consider critical and want to stay in the stable version as long as possible even if a canary is in progress.
99

@@ -91,9 +91,53 @@ This defines the following routes
9191
1. `always-old-version` at host `old.example.com` sees always old/stable version (1 backing service)
9292
1. `always-new-version` at new `app.example.com` sees always new/unstable version (1 backing service)
9393

94+
Then in your Rollout manifest you only mention the "canary-route" HTTPRoute. This is the only route that Argo Rollouts will manage. The other 2 routes will always stay the same (always old or always new version) regardless of what the canary is doing.
95+
96+
```yaml
97+
apiVersion: argoproj.io/v1alpha1
98+
kind: Rollout
99+
metadata:
100+
name: static-rollouts-demo
101+
spec:
102+
replicas: 5
103+
strategy:
104+
canary:
105+
canaryService: argo-rollouts-canary-service
106+
stableService: argo-rollouts-stable-service
107+
trafficRouting:
108+
plugins:
109+
argoproj-labs/gatewayAPI:
110+
# only the canary route is managed by Argo rollouts
111+
httpRoute: canary-route
112+
namespace: default # namespace where this rollout resides
113+
steps:
114+
- setWeight: 10
115+
- pause: {}
116+
- setWeight: 50
117+
- pause: { duration: 10 }
118+
revisionHistoryLimit: 2
119+
selector:
120+
matchLabels:
121+
app: static-rollouts-demo
122+
template:
123+
metadata:
124+
labels:
125+
app: static-rollouts-demo
126+
spec:
127+
containers:
128+
- name: static-rollouts-demo
129+
image: kostiscodefresh/summer-of-k8s-app:v1
130+
ports:
131+
- name: http
132+
containerPort: 8080
133+
protocol: TCP
134+
135+
```
94136
When a canary is not in progress then all clients see the same/active version without any further changes.
95137

96-
## Making applications "canary-aware"
138+
## Scenario - making applications "canary-aware"
139+
140+
Another advanced use case is when you want smarter applications that act differently depending on the current state of the rollout process.
97141

98142
Under normal circumstances an application doesn't know if it is part of canary or not. This is normally not a problem when all your applications are stateless and communicate via HTTP calls.
99143

@@ -196,6 +240,17 @@ spec:
196240
fieldRef:
197241
fieldPath: metadata.labels
198242
```
243+
199244
This Rollout passes different RabbitMQ settings to the canary application.
200245
The settings will be available to the pod in a file at `/etc/podinfo/labels` where the source code will need to read them.
201246

247+
The file will contain the labels in the following format
248+
249+
```
250+
role="preview"
251+
rabbitHost=localhost
252+
rabbitPort=5672
253+
rabbitQueue=myProductionQueue
254+
```
255+
256+
You can easily read this file with your favorite programming language into a settings object.

0 commit comments

Comments
 (0)