Test Your Application in a Kubernetes Setup on the Google Cloud Platform

Prerequisites

  • Google Cloud account with a project and cluster
  • Google Cloud SDK
  • Kubectl

Procedure

  1. Execute these commands from a terminal window:
    gcloud auth login
    gcloud config set project <your project name>
    gcloud config set container/cluster <your cluster name>
    gcloud container clusters get-credentials <your cluster name> --zone <your cluster zone name>
    kubectl get nodes 
    
  2. Tag the application image created in the previous step.
    docker tag bwce-jms-basic-app gcr.io/<your project name>/bwce-jms-basic-app
    
    
  3. Push your application image to Google Container Registry.
    gcloud docker push gcr.io/<your project name>/bwce-jms-basic-app
    
     
  4. Confirm that the image is present in the Google Container Registry.
  5. Open the manifest.yml file and update the application image name. Ensure the image name follows the format
    gcr.io/<your project name>/<image name>
    
    
  6. Type in the following command to create the service:
    kubectl create -f manifest.yml
    
    
  7. To check that application has started successfully, execute the following command:
    kubectl logs <pod name>
    
    
  8. When the application is successfully deployed, the console will display messages such as:
     00:48:07.621 INFO  [bwEngThread:In-Memory Process Worker-1] 
    c.t.b.p.g.L.t.b.s.p.j.B.m.LogBeforeReq - Sending The Request
    00:48:07.645 INFO  [bwEngThread:In-Memory Process Worker-2] 
    c.t.b.p.g.L.t.b.s.p.j.B.m.LogAfterReply - ***** JMSRequestReply Received the Response ****==*** 
    Sending A Reply Back For Request Message Received *****
    00:48:07.645 INFO  [bwEngThread:In-Memory Process Worker-3] 
    c.t.b.p.g.L.t.b.s.p.j.B.m.LogReceiveMessage - Received a Queue Message. Request = 
    Sending a Request JMS Message. JMSMessageID = ID:EMS-SERVER.95A15639F97F35:1