Skip to content

Commit 93ed9ab

Browse files
committed
Fix Gloo image paths
1 parent d0ab4d6 commit 93ed9ab

File tree

1 file changed

+41
-36
lines changed

1 file changed

+41
-36
lines changed

content/en/blog/_posts/2020-04-22-two-phased-canary-rollout-with-gloo.md

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ How do we bring a new application online? How do we upgrade an application? How
1717
platform, ops, and development teams?
1818

1919
In this post, we're going to use Gloo to design a two-phased canary rollout workflow for application upgrades:
20-
* In the first phase, we'll do canary testing by shifting a small subset of traffic to the new version. This allows you to safely perform smoke and correctness tests.
21-
* In the second phase, we'll progressively shift traffic to the new version, allowing us to monitor the new version under load, and eventually, decommission the old version.
20+
21+
- In the first phase, we'll do canary testing by shifting a small subset of traffic to the new version. This allows you to safely perform smoke and correctness tests.
22+
- In the second phase, we'll progressively shift traffic to the new version, allowing us to monitor the new version under load, and eventually, decommission the old version.
2223

2324
To keep it simple, we're going to focus on designing the workflow using [open source Gloo](https://github.com/solo-io/gloo), and we're going to deploy the gateway and
2425
application to Kubernetes. At the end, we'll talk about a few extensions and advanced topics that could be interesting to explore in a follow up.
@@ -30,10 +31,10 @@ features, and can be run against a local test cluster such as [minikube](https:/
3031
This post assumes a basic understanding of Kubernetes and how to interact with it using `kubectl`.
3132

3233
We'll install the latest [open source Gloo](https://github.com/solo-io/gloo) to the `gloo-system` namespace and deploy
33-
version `v1` of an example application to the `echo` namespace. We'll expose this application outside the cluster
34-
by creating a route in Gloo, to end up with a picture like this:
34+
version `v1` of an example application to the `echo` namespace. We'll expose this application outside the cluster
35+
by creating a route in Gloo, to end up with a picture like this:
3536

36-
![Setup](/static/images/blog/2020-04-17-two-phased-canary-rollout-with-gloo/setup.png)
37+
![Setup](/images/blog/2020-04-22-two-phased-canary-rollout-with-gloo/setup.png)
3738

3839
### Deploying Gloo
3940

@@ -88,11 +89,12 @@ shifting traffic to a `v2` version of the application.
8889

8990
Kubernetes gives us a lot of flexibility in terms of modeling this application. We'll adopt the following
9091
conventions:
91-
* We'll include the version in the deployment name so we can run two versions of the application
92-
side-by-side and manage their lifecycle differently.
93-
* We'll label pods with an app label (`app: echo`) and a version label (`version: v1`) to help with our canary rollout.
94-
* We'll deploy a single Kubernetes `Service` for the application to set up networking. Instead of updating
95-
this or using multiple services to manage routing to different versions, we'll manage the rollout with Gloo configuration.
92+
93+
- We'll include the version in the deployment name so we can run two versions of the application
94+
side-by-side and manage their lifecycle differently.
95+
- We'll label pods with an app label (`app: echo`) and a version label (`version: v1`) to help with our canary rollout.
96+
- We'll deploy a single Kubernetes `Service` for the application to set up networking. Instead of updating
97+
this or using multiple services to manage routing to different versions, we'll manage the rollout with Gloo configuration.
9698

9799
The following is our `v1` echo application:
98100

@@ -148,13 +150,15 @@ kubectl apply -f https://raw.githubusercontent.com/solo-io/gloo-ref-arch/blog-30
148150
```
149151

150152
We should see the following output:
153+
151154
```
152155
namespace/echo created
153156
deployment.apps/echo-v1 created
154157
service/echo created
155158
```
156159

157160
And we should be able to see all the resources healthy in the `echo` namespace:
161+
158162
```
159163
➜ kubectl get all -n echo
160164
NAME READY STATUS RESTARTS AGE
@@ -210,7 +214,7 @@ metadata:
210214
spec:
211215
virtualHost:
212216
domains:
213-
- '*'
217+
- "*"
214218
routes:
215219
- matchers:
216220
- prefix: /
@@ -237,14 +241,14 @@ version:v1
237241

238242
Our setup is complete, and our cluster now looks like this:
239243

240-
![Setup](/static/images/blog/2020-04-17-two-phased-canary-rollout-with-gloo/setup.png)
244+
![Setup](/images/blog/2020-04-22-two-phased-canary-rollout-with-gloo/setup.png)
241245

242246
## Two-Phased Rollout Strategy
243247

244248
Now we have a new version `v2` of the echo application that we wish to roll out. We know that when the
245249
rollout is complete, we are going to end up with this picture:
246250

247-
![End State](/static/images/blog/2020-04-17-two-phased-canary-rollout-with-gloo/end-state.png)
251+
![End State](/images/blog/2020-04-22-two-phased-canary-rollout-with-gloo/end-state.png)
248252

249253
However, to get there, we may want to perform a few rounds of testing to ensure the new version of the application
250254
meets certain correctness and/or performance acceptance criteria. In this post, we'll introduce a two-phased approach to
@@ -268,7 +272,7 @@ In this phase, we'll deploy `v2`, and then use a header `stage: canary` to start
268272
traffic to the new version. We'll use this header to perform some basic smoke testing and make sure `v2` is working the
269273
way we'd expect:
270274

271-
![Subset Routing](/static/images/blog/2020-04-17-two-phased-canary-rollout-with-gloo/subset-routing.png)
275+
![Subset Routing](/images/blog/2020-04-22-two-phased-canary-rollout-with-gloo/subset-routing.png)
272276

273277
### Setting up subset routing
274278

@@ -284,7 +288,7 @@ metadata:
284288
spec:
285289
virtualHost:
286290
domains:
287-
- '*'
291+
- "*"
288292
routes:
289293
- matchers:
290294
- prefix: /
@@ -382,7 +386,7 @@ metadata:
382386
spec:
383387
virtualHost:
384388
domains:
385-
- '*'
389+
- "*"
386390
routes:
387391
- matchers:
388392
- headers:
@@ -464,7 +468,7 @@ metadata:
464468
spec:
465469
virtualHost:
466470
domains:
467-
- '*'
471+
- "*"
468472
routes:
469473
# We'll keep our route from before if we want to continue testing with this header
470474
- matchers:
@@ -502,17 +506,17 @@ spec:
502506
values:
503507
version: v2
504508
weight: 0
505-
506509
```
507510

508511
We can apply this virtual service update to the cluster with the following commands:
512+
509513
```
510514
kubectl apply -f https://raw.githubusercontent.com/solo-io/gloo-ref-arch/blog-30-mar-20/platform/prog-delivery/two-phased-with-os-gloo/3-progressive-traffic-shift-to-v2/vs-1.yaml
511515
```
512516

513517
Now the cluster looks like this, for any request that doesn't have the `stage: canary` header:
514518

515-
![Initialize Traffic Shift](/static/images/blog/2020-04-17-two-phased-canary-rollout-with-gloo/init-traffic-shift.png)
519+
![Initialize Traffic Shift](/images/blog/2020-04-22-two-phased-canary-rollout-with-gloo/init-traffic-shift.png)
516520

517521
With the initial weights, we should see the gateway continue to serve `v1` for all traffic.
518522

@@ -525,7 +529,7 @@ version:v1
525529

526530
To simulate a load test, let's shift half the traffic to `v2`:
527531

528-
![Load Test](/static/images/blog/2020-04-17-two-phased-canary-rollout-with-gloo/load-test.png)
532+
![Load Test](/images/blog/2020-04-22-two-phased-canary-rollout-with-gloo/load-test.png)
529533

530534
This can be expressed on our virtual service by adjusting the weights:
531535

@@ -538,7 +542,7 @@ metadata:
538542
spec:
539543
virtualHost:
540544
domains:
541-
- '*'
545+
- "*"
542546
routes:
543547
- matchers:
544548
- headers:
@@ -607,7 +611,7 @@ We will save these topics for a future post on advanced canary testing use cases
607611
608612
We will continue adjusting weights until eventually, all of the traffic is now being routed to `v2`:
609613
610-
![Final Shift](/static/images/blog/2020-04-17-two-phased-canary-rollout-with-gloo/final-shift.png)
614+
![Final Shift](/images/blog/2020-04-22-two-phased-canary-rollout-with-gloo/final-shift.png)
611615
612616
Our virtual service will look like this:
613617
@@ -620,7 +624,7 @@ metadata:
620624
spec:
621625
virtualHost:
622626
domains:
623-
- '*'
627+
- "*"
624628
routes:
625629
- matchers:
626630
- headers:
@@ -661,6 +665,7 @@ spec:
661665
```
662666

663667
We can apply that to the cluster with the following command:
668+
664669
```
665670
kubectl apply -f https://raw.githubusercontent.com/solo-io/gloo-ref-arch/blog-30-mar-20/platform/prog-delivery/two-phased-with-os-gloo/3-progressive-traffic-shift-to-v2/vs-3.yaml
666671
```
@@ -693,7 +698,7 @@ metadata:
693698
spec:
694699
virtualHost:
695700
domains:
696-
- '*'
701+
- "*"
697702
routes:
698703
- matchers:
699704
- prefix: /
@@ -721,7 +726,7 @@ kubectl delete deploy -n echo echo-v1
721726

722727
Now our cluster looks like this:
723728

724-
![End State](/static/images/blog/2020-04-17-two-phased-canary-rollout-with-gloo/end-state.png)
729+
![End State](/images/blog/2020-04-22-two-phased-canary-rollout-with-gloo/end-state.png)
725730

726731
And requests to the gateway return this:
727732

@@ -736,26 +741,26 @@ We have now completed our two-phased canary rollout of an application update usi
736741

737742
Over the course of this post, we collected a few topics that could be a good starting point for advanced exploration:
738743

739-
* Using the **JWT** filter to verify JWTs, extract claims onto headers, and route to canary versions depending on a claim value.
740-
* Looking at **Prometheus metrics** and **Grafana dashboards** created by Gloo to monitor the health of the rollout.
741-
* Automating the rollout by integrating **Flagger** with **Gloo**.
744+
- Using the **JWT** filter to verify JWTs, extract claims onto headers, and route to canary versions depending on a claim value.
745+
- Looking at **Prometheus metrics** and **Grafana dashboards** created by Gloo to monitor the health of the rollout.
746+
- Automating the rollout by integrating **Flagger** with **Gloo**.
742747

743748
A few other topics that warrant further exploration:
744749

745-
* Supporting **self-service** upgrades by giving teams ownership over their upstream and route configuration
746-
* Utilizing Gloo's **delegation** feature and Kubernetes **RBAC** to decentralize the configuration management safely
747-
* Fully automating the continuous delivery process by applying **GitOps** principles and using tools like **Flux** to push config to the cluster
748-
* Supporting **hybrid** or **non-Kubernetes** application use-cases by setting up Gloo with a different deployment pattern
749-
* Utilizing **traffic shadowing** to begin testing the new version with realistic data before shifting production traffic to it
750+
- Supporting **self-service** upgrades by giving teams ownership over their upstream and route configuration
751+
- Utilizing Gloo's **delegation** feature and Kubernetes **RBAC** to decentralize the configuration management safely
752+
- Fully automating the continuous delivery process by applying **GitOps** principles and using tools like **Flux** to push config to the cluster
753+
- Supporting **hybrid** or **non-Kubernetes** application use-cases by setting up Gloo with a different deployment pattern
754+
- Utilizing **traffic shadowing** to begin testing the new version with realistic data before shifting production traffic to it
750755

751756
## Get Involved in the Gloo Community
752757

753758
Gloo has a large and growing community of open source users, in addition to an enterprise customer base. To learn more about
754759
Gloo:
755760

756-
* Check out the [repo](https://github.com/solo-io/gloo), where you can see the code and file issues
757-
* Check out the [docs](https://docs.solo.io/gloo/latest), which have an extensive collection of guides and examples
758-
* Join the [slack channel](http://slack.solo.io/) and start chatting with the Solo engineering team and user community
761+
- Check out the [repo](https://github.com/solo-io/gloo), where you can see the code and file issues
762+
- Check out the [docs](https://docs.solo.io/gloo/latest), which have an extensive collection of guides and examples
763+
- Join the [slack channel](http://slack.solo.io/) and start chatting with the Solo engineering team and user community
759764

760765
If you'd like to get in touch with me (feedback is always appreciated!), you can find me on the
761766
[Solo slack](http://slack.solo.io/) or email me at **[email protected]**.

0 commit comments

Comments
 (0)