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, follow these steps:
    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 service application image created in the previous step.
    docker tag bwce-service-discovery-service-app gcr.io/<your project name>/bwce-service-discovery-service-app
    
    
  3. Push your application image to Google Container Registry.
    gcloud docker push gcr.io/<your project name>/bwce-service-discovery-service-app
    
    
  4. Confirm that the image is present in the Google Container Registry.
  5. Open manifest-service.yml file and update application image name, the Consul server URL, and the service name. Ensure the image name follows the format:
    gcr.io/<your gcloud project name>/<image name>
    
    
  6. Execute the following command to create the service:
    kubectl create -f manifest-service.yml
    
    
  7. Tag the service application image created in the previous step.
    docker tag bwce-service-discovery-client-app gcr.io/<your project name>/bwce-service-discovery-clien-app
  8. Push your application image to Google Container Registry.
    gcloud docker push gcr.io/<your project name>/bwce-service-discovery-client-app
    
    
  9. Confirm that the image is present in the Google Container Registry.
  10. Open manifest-client.yml file and update application image name, Consul server URL, and the service name. Ensure the image name follows the format:
    gcr.io/<your gcloud project name>/<image name>
    
    
  11. Execute the following command to create the service:
    kubectl create -f manifest-client.yml
    
    
  12. To check that the service and client applications have started successfully, execute the command:
    kubectl logs pod-name
    
  13. The external IP address will be available in a few minutes.
    Check for this using the following command:
    kubectl get services
  14. Using a browser, send a request to the client application by using it's external IP address.
    http://<EXTERNAL-IP>:80

Result

The following output should be seen in the browser:

Hello from TIBCO"