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

Allow selectors to be overwritten when starting experiments #249

Merged
merged 1 commit into from
Oct 31, 2019
Merged
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
11 changes: 0 additions & 11 deletions examples/example-active-service.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions examples/example-experiment.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions examples/example-preview-service.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions examples/example-rollout-bluegreen.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions examples/example-rollout-canary-run-tmp-canary.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions examples/example-rollout-canary.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions examples/example-rollout-rolling-update.yaml

This file was deleted.

35 changes: 35 additions & 0 deletions examples/rollout-baseline-vs-canary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This example demonstrates how start a new baseline and canary stack as part of the Rollout update.
# Comparing a canary against a baseline (as opposed to existing production instances) is considered
# a common best practice when performing canary analysis, since it eliminates many differences that
# may skew the results of an analysis (cache warmup time, heap size, etc).
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollout-baseline-vs-canary
spec:
replicas: 5
minReadySeconds: 10
revisionHistoryLimit: 3
selector:
matchLabels:
app: rollout-baseline-vs-canary
template:
metadata:
labels:
app: rollout-baseline-vs-canary
spec:
containers:
- name: rollouts-demo
image: argoproj/rollouts-demo:blue
imagePullPolicy: Always
ports:
- containerPort: 8080
strategy:
canary:
steps:
- experiment:
templates:
- name: baseline
specRef: stable
- name: canary
specRef: canary
64 changes: 64 additions & 0 deletions examples/rollout-bluegreen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This example demonstrates a Rollout using the blue-green update strategy, which contains a manual
# gate before promoting the new stack.
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollout-bluegreen
spec:
replicas: 1
minReadySeconds: 10
revisionHistoryLimit: 3
selector:
matchLabels:
app: rollout-bluegreen
template:
metadata:
labels:
app: rollout-bluegreen
spec:
containers:
- name: rollouts-demo
image: argoproj/rollouts-demo:blue
imagePullPolicy: Always
ports:
- containerPort: 8080
strategy:
blueGreen:
# activeService specifies the service to update with the new template hash at time of promotion.
# This field is mandatory for the blueGreen update strategy.
activeService: rollout-bluegreen-active
# previewService specifies the service to update with the new template hash before promotion.
# This allows the preview stack to be reachable without serving production traffic.
# This field is optional.
previewService: rollout-bluegreen-preview
# autoPromotionEnabled disables automated promotion of the new stack by pausing the rollout
# immediately before the promotion. If omitted, the default behavior is to promote the new
# stack as soon as the ReplicaSet are completely ready/available.
# Rollouts can be resumed using: `kubectl argo rollouts resume ROLLOUT`
autoPromotionEnabled: false

---
kind: Service
apiVersion: v1
metadata:
name: rollout-bluegreen-active
spec:
selector:
app: rollout-bluegreen
ports:
- protocol: TCP
port: 80
targetPort: 8080

---
kind: Service
apiVersion: v1
metadata:
name: rollout-bluegreen-preview
spec:
selector:
app: rollout-bluegreen
ports:
- protocol: TCP
port: 80
targetPort: 8080
71 changes: 71 additions & 0 deletions examples/rollout-canary-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This example demonstrates how to deploy a preview ReplicaSet using an Experiment. The preview
# ReplicaSet will run but receive no production traffic, since its selector labels are set
# differently than the rollout's selector labels.
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollout-canary-preview
spec:
replicas: 5
minReadySeconds: 10
revisionHistoryLimit: 3
selector:
matchLabels:
app: rollout-canary-production
template:
metadata:
labels:
app: rollout-canary-production
spec:
containers:
- name: rollouts-demo
image: argoproj/rollouts-demo:blue
imagePullPolicy: Always
ports:
- containerPort: 8080
strategy:
canary:
steps:
# The initial step starts an experiment that runs a single pod ReplicaSet using the new pod spec
# When the experiment is terminated, the rollout will progress through rest of the canary steps.
- experiment:
templates:
- name: canary-preview
specRef: canary
# Selector and metadata are overwritten to be something different from the rollout's
# spec.selector. This allows the preview stack to be reachable through a different
# service without receiving production traffic.
selector:
matchLabels:
app: rollout-canary-preview
metadata:
labels:
app: rollout-canary-preview

---
# The rollout-canary-preview service will point to the preview stack, making them reachable without
# exposing them to production traffic.
kind: Service
apiVersion: v1
metadata:
name: rollout-canary-preview
spec:
selector:
app: rollout-canary-preview
ports:
- protocol: TCP
port: 80
targetPort: 8080

---
kind: Service
apiVersion: v1
metadata:
name: rollout-canary-production
spec:
selector:
app: rollout-canary-production
ports:
- protocol: TCP
port: 80
targetPort: 8080
38 changes: 38 additions & 0 deletions examples/rollout-canary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This example demonstrates a Rollout using the canary update strategy with a customized rollout
# plan. The prescribed steps initially sets a canary weight of 20%, then pauses indefinitely. Once
# resumed, the rollout performs a gradual, automated 20% weight increase until it reaches 100%.
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollout-canary
spec:
replicas: 5
minReadySeconds: 10
revisionHistoryLimit: 3
selector:
matchLabels:
app: rollout-canary
template:
metadata:
labels:
app: rollout-canary
spec:
containers:
- name: rollouts-demo
image: argoproj/rollouts-demo:blue
imagePullPolicy: Always
ports:
- containerPort: 8080
strategy:
canary:
steps:
- setWeight: 20
# The following pause step will pause the rollout indefinitely until manually resumed.
# Rollouts can be manually resumed by running `kubectl argo rollouts resume ROLLOUT`
- pause: {}
- setWeight: 40
- pause: {duration: 40}
- setWeight: 60
- pause: {duration: 20}
- setWeight: 80
- pause: {duration: 20}
Loading