Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ping-pong services #1697

Merged
merged 46 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9aac872
codegen before
perenesenko Dec 8, 2021
5969473
feat: ping-pong reconcile services
perenesenko Dec 8, 2021
693b6af
feat: ping-pong reconcile alb traffic
perenesenko Dec 8, 2021
996720b
feat: ping-pong scaling down the otherRs
perenesenko Dec 9, 2021
93ed41b
feat: ping-pong, refactoring extract getReferencedService method
perenesenko Dec 9, 2021
f6ef5d9
feat: ping-pong services validation
perenesenko Dec 10, 2021
e6ecce8
feat: ping-pong services to display in the kubectl-argo-rollouts term…
perenesenko Dec 10, 2021
822fb54
fix lint error for the rollout package
perenesenko Dec 13, 2021
92032bc
fix merge errors
perenesenko Dec 13, 2021
5fcde84
codegen
perenesenko Dec 15, 2021
9d38b43
feat: ping-pong, tests
perenesenko Dec 21, 2021
6064c40
feat: ping-pong, tests
perenesenko Dec 21, 2021
774c918
feat: ping-pong, tests, reuse assertWeights method
perenesenko Dec 21, 2021
9ee383d
feat: ping-pong, simplify code in a reconcilePingAndPongService
perenesenko Dec 21, 2021
e92f710
feat: fix tests, ordering the stableService, canaryService
perenesenko Dec 22, 2021
c2faa97
feat: set the root service field required for alb and ping-pong
perenesenko Dec 23, 2021
7ed0f7f
tests for ping-pong validation
perenesenko Dec 23, 2021
b1d2f25
test swapping ping and pong
perenesenko Dec 23, 2021
b0fb0f2
tests for validation
perenesenko Jan 3, 2022
35ce2a2
tests TestPromoteStable
perenesenko Jan 4, 2022
ad1ca10
tests TestReconcilePingAndPongService
perenesenko Jan 4, 2022
c03c681
tests TestPingPongCanaryRolloutInfo
perenesenko Jan 4, 2022
af40c6c
remove bad test TestPingPongCanaryPromoteFull
perenesenko Jan 4, 2022
498e038
test TestCanaryRolloutWithPingPongServices also test invalid ping and…
perenesenko Jan 5, 2022
97651a2
testing: rootService is required for the ALB; ping-pong service keys
perenesenko Jan 5, 2022
6afc04b
testing: get rollout status for ping-pong
perenesenko Jan 5, 2022
6dfee5c
Fix TestALBPingPongUpdate test, update the Ingress apiVersion
perenesenko Jan 6, 2022
0e6168a
remove the unused/commented code. inline the PingPongOpposite method
perenesenko Jan 12, 2022
50a8ead
Merge branch 'master' into ping-pong
perenesenko Jan 14, 2022
5103ea7
launch codegen after the merge
perenesenko Jan 15, 2022
25fd2f4
fixing the codegen issue
perenesenko Jan 18, 2022
d6ba2df
Merge branch 'master' into ping-pong
perenesenko Jan 18, 2022
1e4454a
adding documentation for the ping-pong
perenesenko Jan 19, 2022
e260fc9
Merge branch 'master' into ping-pong
perenesenko Jan 19, 2022
c625d64
launch codegen after merging from master
perenesenko Jan 19, 2022
fcf18a4
switch the ping/pong service labels regardless the RS availability
perenesenko Jan 20, 2022
d3d0a6d
Merge branch 'master' into ping-pong
perenesenko Jan 31, 2022
1fad6ba
fix lint error after the merge
perenesenko Feb 1, 2022
c54e1b3
adding validation so ping-pong feature support only ALB traffic routing
perenesenko Feb 1, 2022
e79f70c
Merge branch 'master' into ping-pong
perenesenko Feb 1, 2022
0d1d08e
codegen after merge
perenesenko Feb 1, 2022
962e9a1
adding validation so ping-pong feature support only ALB traffic routing
perenesenko Feb 2, 2022
7a2ef91
Merge branch 'master' into ping-pong
perenesenko Feb 2, 2022
9eb2d48
codegen after merge
perenesenko Feb 2, 2022
13848d1
Merge branch 'master' into ping-pong
perenesenko Feb 4, 2022
94412cc
codegen after merge
perenesenko Feb 4, 2022
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
49 changes: 49 additions & 0 deletions docs/features/traffic-management/alb.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,55 @@ include:
* [kube2iam](https://github.com/jtblin/kube2iam)
* [EKS ServiceAccount IAM Roles](https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html)

### Zero-Downtime Updates with Ping-Pong feature

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/)
when running the AWS LoadBalancer in IP mode. There is a challenge with that approach, modifications
of the Service selector labels (`spec.selector`) not allowed the AWS LoadBalancer controller to mutate the readiness gates.
And Ping-Pong feature helps to deal with that challenge. At some particular moment one of the services (e.g. ping) is "wearing a
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
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.
The Rollout status object holds the value of who is currently the stable ping or pong (`status.canary.currentPingPong`).
And this way allows the rollout to use pod readiness gate injection as the
services are not changing their labels at the end of the rollout progress.

!!!important

Ping-Pong feature available since Argo Rollouts v1.2

## Example
```yaml
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: example-rollout
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.15.4
ports:
- containerPort: 80
strategy:
canary:
pingPong: #Indicates that the ping-pong services enabled
pingService: ping-service
pongService: pong-service
trafficRouting:
alb:
ingress: alb-ingress
servicePort: 80
steps:
- setWeight: 20
- pause: {}
```

### Custom annotations-prefix

Expand Down
12 changes: 12 additions & 0 deletions manifests/crds/rollout-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,16 @@ spec:
- type: integer
- type: string
x-kubernetes-int-or-string: true
pingPong:
properties:
pingService:
type: string
pongService:
type: string
required:
- pingService
- pongService
type: object
scaleDownDelayRevisionLimit:
format: int32
type: integer
Expand Down Expand Up @@ -3168,6 +3178,8 @@ spec:
- name
- status
type: object
stablePingPong:
type: string
weights:
properties:
additional:
Expand Down
12 changes: 12 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11338,6 +11338,16 @@ spec:
- type: integer
- type: string
x-kubernetes-int-or-string: true
pingPong:
properties:
pingService:
type: string
pongService:
type: string
required:
- pingService
- pongService
type: object
scaleDownDelayRevisionLimit:
format: int32
type: integer
Expand Down Expand Up @@ -14119,6 +14129,8 @@ spec:
- name
- status
type: object
stablePingPong:
type: string
weights:
properties:
additional:
Expand Down
12 changes: 12 additions & 0 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11338,6 +11338,16 @@ spec:
- type: integer
- type: string
x-kubernetes-int-or-string: true
pingPong:
properties:
pingService:
type: string
pongService:
type: string
required:
- pingService
- pongService
type: object
scaleDownDelayRevisionLimit:
format: int32
type: integer
Expand Down Expand Up @@ -14119,6 +14129,8 @@ spec:
- name
- status
type: object
stablePingPong:
type: string
weights:
properties:
additional:
Expand Down
Loading