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
  • The Hystrix Dashboard must be set up locally in your environment.

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 application image created in the previous step.
    docker tag bwce-hystrix.app gcr.io/<your project name>/bwce-hystrix.app
    
    
  3. Push your application image to Google Container Registry.
    gcloud docker push gcr.io/<your project name>/bwce-hystrix.app
    
    
  4. Confirm that the image is present in the Google Container Registry.
  5. Open manifest.yml file and update application image 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.yml
    
    
  7. To check that application has started successfully, execute the command
    kubectl logs pod-name
    
  8. The external IP address will be available in a few minutes.
    Check for this using the following command:
    kubectl get services
  9. Edit the request_news.html page found in samples > docker > core > Hystrix directory.
  10. Replace the URL http://127.0.0.1:8080 with the routable URL of the application.
  11. Save the file.
  12. Open the request_news.html file in a web browser
  13. Click the Get News from Wiki! button to request headlines from the associated web page.

Result

In your Hystrix dashboard, use the following to view the configured command:
http://<SERVICE-EXTERNAL-IP>:8090/hystrix.stream

Once the news is displayed in the browser you can view the Hystrix dashboard with the command name specified as shown in Testing in TIBCO Business Studio for BusinessWorks.