Testing the 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, follow these steps:
    gcloud auth login
    gcloud config set project <your project>
    gcloud config set container/cluster <your cluster>
    gcloud container clusters get-credentials <your cluster> --zone <your cluster zone>
    kubectl get nodes 
    
  2. Tag the application image created in the previous step.
    docker tag bwce-jdbc-basic-app gcr.io/<your project>/bwce-jdbc-basic-app
    
    
  3. Push your application image to Google Container Registry.
    gcloud docker push gcr.io/<your project>/bwce-jdbc-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 gcloud project name>/<image name>
    
  6. Navigate to the samples directory where the manifest file is present and type in the below command to create the service:
    kubectl create -f manifest.yml
    
    
  7. To check that application is started successfully, type in below command
    kubectl logs pod-name
    
    

Result

If the application deploys successfully, you will see a similar output in the console log.
 
05:16:00.763 INFO [bwEngThread:In-Memory Process Worker-5] 
c.t.b.p.g.L.t.b.s.p.jdbc.Basic.Log - Records Updated By JDBCUpdate Activity: 1