Skip to content

Latest commit

 

History

History

06-webapp-deployment-ext-ingress

GKE Workshop LAB-06

Web-Application Deployment, GCE-Ingress Example

Context License

Introduction

In the following lab we will set up our local development environment, provision the workshop cluster and roll out a static nginx page. Your deployment will be exposed by corresponding pod-service and wait for incoming traffic through our GCE Ingress-Controller (http://<external-lb-ip>). The created LB will utilize Container Native Load Balancing to send traffic directly to the Pods.

Deployment

  1. Run deployment
kubectl apply -f .
  1. Check current ingress state (address)

this step can take up to 3 Minutes

kubectl get ingress -n doit-lab-06 --watch
  1. Confirm that a Load Balancer was created on the cloud
gcloud compute forwarding-rules list --filter='description~doit-lab-06'

Cluster Application Check / Playground

  1. You can check the state of Pods at any time with the following kubectl command:
kubectl get pods -n doit-lab-06
  1. You can check your ingress target service with the following kubectl command:
kubectl get service -n doit-lab-06
  1. You can get some more detailed information about your ingress resource by the following kubectl command:
kubectl describe ingress static-web-app-ingress -n doit-lab-06
  1. A couple of minutes after your ingress resource, ingress controller and the corresponding loadBalancer is provisioned (3-4 minutes):

4.1 You can check the benchmark of your web-application using apache-bench command as shown below:

ab -n 20 http://<external-ip-of-your-ingress-load-balancer>/

4.2 You can simulate some traffic to your ingress facing loadBalancer by the following ab-command:

ab -n 500 -c 25 http://<external-ip-of-your-ingress-load-balancer>/

4.3 Or just visit the application by hitting your load-balancers external-IP:

  -> http://<external-ip-of-your-ingress-load-balancer>/

Optional Steps

Now we can set the current k8s context to our lab exercise namespace doit-lab-06 to make sure that every command set is run against this lab resources.

kubectl config set-context --current --namespace=doit-lab-06

Application Clean-Up

kubectl delete -f .

Links