Test your Application in the Kubernetes Setup on the Google Cloud Platform

Prerequisites

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

Procedure

  1. From a terminal, execute the following commands:
    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-consul-app gcr.io/<your project name>/bwce-jms-consul-app
    
    
  3. Push your application image to Google Container Registry.
    gcloud docker push gcr.io/<your project name>/bwce-jms-consul-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 gcloud project name>/<image name>
    
    
  6. Navigate to the samples directory where the manifest file is present and execute the following command to create the service:
    kubectl create -f manifest.yml
    
    
  7. To check that application is started successfully, execute the command:
    kubectl logs <pod name> 
    
    

Result

If the application deploys successfully, you will see a similar output in the console log.
22:16:36.973 INFO  [bwEngThread:In-Memory Process Worker-1] c.t.b.p.g.L.t.b.s.p.j.C.BeforeJMSRequest - Sending a JMS Request Message to queue consul.queue
22:16:37.004 INFO  [bwEngThread:In-Memory Process Worker-2] c.t.b.p.g.L.t.b.s.p.j.C.LogReceiveMessage - JMSReceiver Received a Message
22:16:37.028 INFO  [bwEngThread:In-Memory Process Worker-3] c.t.b.p.g.L.t.b.s.p.jms.Consul.Log1 - Received a Reply From JMSReceiver  ===*** Sending A Reply Back For Request Message Received *****