From bc07dd93d53bae9620df5c8c7c060ba960f71393 Mon Sep 17 00:00:00 2001 From: Jan Bongers Date: Sun, 25 Jun 2023 21:16:58 +0200 Subject: [PATCH] Update SOLUTION.md explanation document --- SOLUTION.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/SOLUTION.md b/SOLUTION.md index f5fb3bf..f672354 100644 --- a/SOLUTION.md +++ b/SOLUTION.md @@ -1,5 +1,23 @@ +# Intro + This document decribes a blue-green deployment using a simple Go web app and Minikube. To get started, you will need to: - Install minikube - Execute `minikube start` to start the cluster + +# Deploying the first version of our application + +Using the Dockerfile a container image is built. We pushed this image to our container registry. +First, we apply the 'blue' deployment by running `kubectl apply -f deployment-blue.yaml` and `kubectl apply -f service.yaml`. +his deploys a pod with a 3 containers running v1.0 of the application. This version contains 5 vehicles in the list. +We get the service URL by running `minikube service vehicles-service --url` +Use curl to make a GET request to the `/vehicles` endpoint. We now get the list of 5 vehicles as a response. + +# Updating our application + +We now make a change to the application, for example by adding a new vehicle to the list. This new version is given version number 1.1. We build the container image again, now with tag 1.1. + +We now apply the "green" deployment by running `kubectl apply -f deployment-green.yaml`. When the deployment is running without issues, we can update our service manifest to now point to our new version 1.1 of the application. This can be done by updating the values under `selector`. The value of `app` will now become the same as `matchLabels.app` in the `deployment-green.yaml` file, which is `vehicles-green` in this case. + +After applying the updated service manifest, we can get the URL again, use curl to call the `/vehicles` endpoint. We can now see the newly added vehicle in the list.