Skip to content

Commit

Permalink
Upgrade Traefik to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Tremel committed Feb 8, 2019
1 parent 219b0ea commit 7333866
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
28 changes: 20 additions & 8 deletions blue-green/multiple-services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ Blue/green deployment to release multiple services simultaneously
=================================================================

> In this example, we release a new version of 2 services simultaneously using
the blue/green deployment strategy.
the blue/green deployment strategy. [Traefik](https://traefik.io) in used as
Ingress controller, this example would also work with the
[Nginx Ingress controller](https://github.com/kubernetes/ingress-nginx).

## Steps to follow

Expand All @@ -15,18 +17,22 @@ the blue/green deployment strategy.
## In practice

Install the latest version of
[Helm](https://docs.helm.sh/using_helm/#installing-helm), then install Traefik:
[Helm](https://docs.helm.sh/using_helm/#installing-helm), then install
[Traefik](https://traefik.io/):

```bash
# Deploy Traefik with Helm
$ helm install --name=traefik --version=1.17.1 stable/traefik
$ helm install \
--name=traefik \
--version=1.60.0 \
--set rbac.enabled=true \
stable/traefik

# Deploy version 1 of application a and b
$ kubectl apply -f app-a-v1.yaml -f app-b-v1.yaml
$ kubectl apply -f ingress-v1.yaml
# Deploy version 1 of application a and b and the ingress
$ kubectl apply -f app-a-v1.yaml -f app-b-v1.yaml -f ingress-v1.yaml

# Test if the deployment was successful
$ ingress=$(minikube service traefik-traefik --url | head -n1)
$ ingress=$(minikube service traefik --url | head -n1)
$ curl $ingress -H 'Host: a.domain.com'
Host: my-app-a-v1-66fb8d6f99-hs8jr, Version: v1.0.0

Expand All @@ -40,12 +46,18 @@ $ watch kubectl get po
# Then deploy version 2 of both applications
$ kubectl apply -f app-a-v2.yaml -f app-b-v2.yaml

# Wait for both applications to be running
$ kubectl rollout status deploy my-app-a-v2 -w
deployment "my-app-a-v2" successfully rolled out

$ kubectl rollout status deploy my-app-b-v2 -w
deployment "my-app-b-v2" successfully rolled out

# Check the status of the deployment, then when all the pods are ready, you can
# update the ingress
$ kubectl apply -f ingress-v2.yaml

# Test if the deployment was successful
$ ingress=$(minikube service traefik-traefik --url | head -n1)
$ curl $ingress -H 'Host: a.domain.com'
Host: my-app-a-v2-6b58d47c5f-nmzds, Version: v2.0.0

Expand Down
4 changes: 4 additions & 0 deletions blue-green/single-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ $ watch kubectl get po
# Then deploy version 2 of the application
$ kubectl apply -f app-v2.yaml

# Wait for all the version 2 pods to be running
$ kubectl rollout status deploy my-app-v2 -w
deployment "my-app-v2" successfully rolled out

# Side by side, 3 pods are running with version 2 but the service still send
# traffic to the first deployment.

Expand Down

0 comments on commit 7333866

Please sign in to comment.