Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Add an example to Canary. #5

Merged
merged 1 commit into from
Apr 12, 2019
Merged
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
38 changes: 38 additions & 0 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,44 @@ For updating an application to a new version:
possible to keep names identical and simply clean up namespaces as new
versions come out.

#### Example implementation

This example implementation is included to illustrate how the `Canary` object
operates. It is not intended to prescribe a particular implementation.

Assume a `Canary` object that looks like:

```yaml
apiVersion: v1beta1
kind: Canary
metadata:
name: my-canary
spec:
service: web
backends:
- service: web-next
weight: 100m
- service: web-current
weight: 900m
```

When a new `Canary` object is created, it instantiates the following Kubernetes objects:
* Service who's name is the same as `spec.service` in the Canary (`web`)
* A Deployment running `nginx` which has labels that match the Service

The nginx layer serves as an HTTP(s) layer which implements the canary. In particular
the nginx config looks like:

```
upstream backend {
server web-next weight=1;
server web-current weight=9;
}
```

Thus the new `web` service when accessed from a client in Kubernetes will send 10% of
it's traffic to `web-next` and 90% of it's traffic to `web`.

### Monitor

The Monitor resource defines a sidecar which is injected alongside the
Expand Down