We have two versions of a website.
The first version V1 looks like :
And the second version V2 looks like :
The goal is to apply the Blue Green strategy deployment to insure that the version V2 of the webiste is deployed with zero-downtime after all checks pass.
I will start by playing with docker-compose techologie.
$> cd blue_green/app
$> docker-compose build
# Create tags
$> cd scripts
$> ./docker.sh
kubectl create ns codeday
# To codeday
kubectl config set-context --current --namespace=codeday
# To default
kubectl config set-context --current --namespace=default
$> cd Demo_CodeWorks/blue_green/k8s
# Codeday V1 Blue Service
$> kubectl create -f nginx-codeday-blue.service.yml -n codeday --save-config --record
# Codeday V1 Green Service
$> kubectl create -f nginx-codeday-green.service.yml -n codeday --save-config --record
export DCK_IMAGE_SUFFIX=codeday-v1-blue
cat nginx-codeday.deployment.yml | sh config.sh | kubectl create -n codeday --save-config --record -f -
cat nginx-codeday-public.service.yml | sh config.sh | kubectl create -n codeday --save-config --record -f -
$> cd scripts
$> ./curl_codeday_public_service.sh
export DCK_IMAGE_SUFFIX=codeday-v2-green
cat nginx-codeday.deployment.yml | sh config.sh | kubectl apply -n codeday --record -f -
cat nginx-codeday-public.service.yml | sh config.sh | kubectl apply -n codeday --record -f -

