You can then create the deployment using the kubectl command.
Save this to service.yaml.
Creating the service will create a load balancer that is accessible outside the cluster.
For the "green" deployment we will deploy a new deployment in parallel wit the "blue" deployment. If the following is in green.yaml...
... I can create the new deployment like so.
To cut over to the "green" deployment we will update the selector for the service. Edit the service.yaml and change the selector version to "1.11". That will make it so that it matches the pods on the "green" deployment.
This apply will update the existing nginx service in place.