How to: Lab 12.4. Blue/Green deployments
[Blue/green deployment](https://kubernetes.io/blog/2018/04/30/zero-downtime-deployment-kubernetes-jenkins/#blue-green-deployment) is a update-strategy used to accomplish zero-downtime deployments. The current version application is marked blue and the new version application is marked green. In Kubernetes, blue/green deployment can be easily implemented with Services.
blue/green update strategy
![blue-green update strategy from https://engineering-skcc.github.io/performancetest/Cloud-%ED%99%98%EA%B2%BD-%EC%84%B1%EB%8A%A5%EB%B6%80%ED%95%98%ED%85%8C%EC%8A%A4%ED%8A%B8/](https://user-images.githubusercontent.com/17856665/185770858-83a088c2-4701-4fd6-943e-ebfb020aa498.gif)
1. Create a `blue` Deployment
   - three replicas
   - image `nginx:1.19-alpine`
   - on the cluster Node, create an HTML document `/mnt/data/index.html` with any content
   - mount the `index.html` file to the DocumentRoot as a _HostPath_ volume
2. Expose `blue` Deployment on port 80 with Service name `bg-svc`
3. Verify created resources and test access with `curl`
4. Create a new `green` Deployment using [1] as base
   - three replicas
   - use a newer version of the image `nginx:1.21-alpine`
   - on the cluster Node, create a new HTML document `/mnt/data2/index.html` with different content
   - mount the `index.html` file to the DocumentRoot as a _HostPath_ volume
5. Verify created resources and test access with `curl`
6. Edit `bg-svc` Service _Selector_ as `app=green` to redirect traffic to `green` Deployment
7. Confirm all working okay with `curl`
8. Delete created resources
lab 12.4 solution
```sh