Update SOLUTION.md explanation document

This commit is contained in:
Jan Bongers 2023-06-25 21:16:58 +02:00
parent c6df41a50a
commit bc07dd93d5

View File

@ -1,5 +1,23 @@
# Intro
This document decribes a blue-green deployment using a simple Go web app and Minikube. This document decribes a blue-green deployment using a simple Go web app and Minikube.
To get started, you will need to: To get started, you will need to:
- Install minikube - Install minikube
- Execute `minikube start` to start the cluster - 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.