Skip to content

Commit 34b4375

Browse files
authored
feat: ping-pong service management (argoproj#1697)
Signed-off-by: Andrii Perenesenko <[email protected]>
1 parent 85de659 commit 34b4375

37 files changed

+1895
-721
lines changed

docs/features/traffic-management/alb.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,55 @@ include:
331331
* [kube2iam](https://github.com/jtblin/kube2iam)
332332
* [EKS ServiceAccount IAM Roles](https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html)
333333

334+
### Zero-Downtime Updates with Ping-Pong feature
335+
336+
Above there was described the recommended way by AWS to solve zero-downtime issue. Is a use a [pod readiness gate injection](https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.2/deploy/pod_readiness_gate/)
337+
when running the AWS LoadBalancer in IP mode. There is a challenge with that approach, modifications
338+
of the Service selector labels (`spec.selector`) not allowed the AWS LoadBalancer controller to mutate the readiness gates.
339+
And Ping-Pong feature helps to deal with that challenge. At some particular moment one of the services (e.g. ping) is "wearing a
340+
hat" of stable service another one (e.g. pong) is "wearing a hat" of canary. At the end of the promotion step all 100% of traffic sending
341+
to the "canary" (e.g. pong). And then the Rollout swapped the hats of ping and pong services so the pong became a stable one.
342+
The Rollout status object holds the value of who is currently the stable ping or pong (`status.canary.currentPingPong`).
343+
And this way allows the rollout to use pod readiness gate injection as the
344+
services are not changing their labels at the end of the rollout progress.
345+
346+
!!!important
347+
348+
Ping-Pong feature available since Argo Rollouts v1.2
349+
350+
## Example
351+
```yaml
352+
apiVersion: argoproj.io/v1alpha1
353+
kind: Rollout
354+
metadata:
355+
name: example-rollout
356+
spec:
357+
selector:
358+
matchLabels:
359+
app: nginx
360+
template:
361+
metadata:
362+
labels:
363+
app: nginx
364+
spec:
365+
containers:
366+
- name: nginx
367+
image: nginx:1.15.4
368+
ports:
369+
- containerPort: 80
370+
strategy:
371+
canary:
372+
pingPong: #Indicates that the ping-pong services enabled
373+
pingService: ping-service
374+
pongService: pong-service
375+
trafficRouting:
376+
alb:
377+
ingress: alb-ingress
378+
servicePort: 80
379+
steps:
380+
- setWeight: 20
381+
- pause: {}
382+
```
334383

335384
### Custom annotations-prefix
336385

manifests/crds/rollout-crd.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,16 @@ spec:
387387
- type: integer
388388
- type: string
389389
x-kubernetes-int-or-string: true
390+
pingPong:
391+
properties:
392+
pingService:
393+
type: string
394+
pongService:
395+
type: string
396+
required:
397+
- pingService
398+
- pongService
399+
type: object
390400
scaleDownDelayRevisionLimit:
391401
format: int32
392402
type: integer
@@ -3202,6 +3212,8 @@ spec:
32023212
- name
32033213
- status
32043214
type: object
3215+
stablePingPong:
3216+
type: string
32053217
weights:
32063218
properties:
32073219
additional:

manifests/install.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11355,6 +11355,16 @@ spec:
1135511355
- type: integer
1135611356
- type: string
1135711357
x-kubernetes-int-or-string: true
11358+
pingPong:
11359+
properties:
11360+
pingService:
11361+
type: string
11362+
pongService:
11363+
type: string
11364+
required:
11365+
- pingService
11366+
- pongService
11367+
type: object
1135811368
scaleDownDelayRevisionLimit:
1135911369
format: int32
1136011370
type: integer
@@ -14170,6 +14180,8 @@ spec:
1417014180
- name
1417114181
- status
1417214182
type: object
14183+
stablePingPong:
14184+
type: string
1417314185
weights:
1417414186
properties:
1417514187
additional:

manifests/namespace-install.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11355,6 +11355,16 @@ spec:
1135511355
- type: integer
1135611356
- type: string
1135711357
x-kubernetes-int-or-string: true
11358+
pingPong:
11359+
properties:
11360+
pingService:
11361+
type: string
11362+
pongService:
11363+
type: string
11364+
required:
11365+
- pingService
11366+
- pongService
11367+
type: object
1135811368
scaleDownDelayRevisionLimit:
1135911369
format: int32
1136011370
type: integer
@@ -14170,6 +14180,8 @@ spec:
1417014180
- name
1417114181
- status
1417214182
type: object
14183+
stablePingPong:
14184+
type: string
1417314185
weights:
1417414186
properties:
1417514187
additional:

0 commit comments

Comments
 (0)