Test Your Application in the Kubernetes Setup on the Google Cloud Platform
Before you begin
- Google cloud account with a project and cluster.
- Google Cloud SDK
- Kubectl
- Setup Prometheus to monitor events and Grafana dashboard provided by resilience4j for visualization.
- Procedure
- 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
- Tag the application image created in the previous step.
docker tag bwce-Resilience4j.app gcr.io/<your project name>/bwce-Resilience4j.app
- Push your application image to Google Container Registry.
gcloud docker push gcr.io/<your project name>/bwce-Resilience4j.app
- Confirm that the image is present in the Google Container Registry.
- Open
manifest.yml
file and update application image name. Ensure the image name follows the format:gcr.io/<your gcloud project name>/<image name>
- Run the following command to create the service:
kubectl create -f manifest.yml
- To check that application has started successfully, run the command
kubectl logs pod-name
- The external IP address is available in a few minutes.
Check for this using the following command:
kubectl get services
- Edit the request_news.html page found in directory.
- Replace the URL
http://127.0.0.1:8080
with the routable URL of the application. - Save the file.
- Open the
request_news.html
file in a web browser - Click the Get News from Wiki! button to request headlines from the associated web page.
Result
In order to view the resilience4j metrics, you need a resilience4j stream URL which is as follows:
http://<SERVICE-EXTERNAL-IP>:8090/resilience4j_metrics
Once the news is displayed in the browser you can view the resilience4j metrics using Grafana dashboard with the command name specified as shown in Testing in TIBCO Business Studio for BusinessWorks.