Skip to content

Latest commit

 

History

History
146 lines (100 loc) · 2.79 KB

README.md

File metadata and controls

146 lines (100 loc) · 2.79 KB

Create the applications

Manifests

INGRESS_IP environment variable is supposed to be set during the setup. You can always set it this way:

export INGRESS_IP=$(kubectl get svc ingress-nginx-controller -n ingress-nginx -o jsonpath='{.status.loadBalancer.ingress[].ip}')

Check the manifests:

cd /workspaces/helm/01_apps-with-only-manifests

tree .

Create the blue app on Development environment

kubectl create ns dev
kubectl create -f dev/blue

Check the status of the pods and see the blue pod running:

kubectl get pods -n dev

Afterwards, you can visit the app via curl:

curl http://${INGRESS_IP}/dev/blue

If you want to reach it via browser, you first need to port-forward ingress-nginx-controller service:

kubectl port-forward svc/ingress-nginx-controller -n ingress-nginx 80

Then, reach via below URLs:

echo "https://${CODESPACE_NAME}-80.app.github.dev/dev/blue"

Create the red app on Development environment

kubectl create -f dev/red

Check the status of the pods and see the red and blue pods running:

kubectl get pods -n dev

Afterwards, you can visit the app via curl:

curl http://${INGRESS_IP}/dev/red

If you want to reach it via browser, you first need to port-forward ingress-nginx-controller service:

kubectl port-forward svc/ingress-nginx-controller -n ingress-nginx 80

Then, reach via below URLs:

echo "https://${CODESPACE_NAME}-80.app.github.dev/dev/red"

Create the blue app on Production

kubectl create ns prod
kubectl create -f prod/blue

Check the status of the pods and see 3 blue pods running:

kubectl get pods -n prod

Afterwards, you can visit the app via curl:

curl http://${INGRESS_IP}/prod/blue

If you want to reach it via browser, you first need to port-forward ingress-nginx-controller service:

kubectl port-forward svc/ingress-nginx-controller -n ingress-nginx 80

Then, reach via below URLs:

echo "https://${CODESPACE_NAME}-80.app.github.dev/prod/blue"

Create the red app on Production

kubectl create -f prod/red

Check the status of the pods and see 3 red and 3 blue pods running:

kubectl get pods -n prod

Afterwards, you can visit the app via curl:

curl http://${INGRESS_IP}/prod/red

If you want to reach it via browser, you first need to port-forward ingress-nginx-controller service:

kubectl port-forward svc/ingress-nginx-controller -n ingress-nginx 80

Then, reach via below URLs:

echo "https://${CODESPACE_NAME}-80.app.github.dev/prod/red"

How long will it take to make a green app on both environments?

Cleanup

# delete the created resources
kubectl delete -f dev/**,prod/**