You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sample Web application is built to demonstrate how to access the omnichannel APIs hosted on IBM Cloud. The application provides the basic function to allow user to browse the Catalog items, make an Order and check the profile. The Web application is built with AngularJS in Web 2.0 Single Page App style. It uses a Node.js backend to host the static content and implement the BFF (Backend for Frontend) pattern.
Here is an overview of the project's features:
AngularJS SPA
Node.js based BFF application to access APIs
Authentication and Authorization through Open ID Connect.
Distributed as Docker container and deployed to Kubernetes cluster.
How it works
Web Microservice serves 'IBM Cloud Native Reference Architecture' suite, available at https://github.com/ibm-cloud-architecture/refarch-cloudnative-kubernetes, Microservice-based reference application. Though it is a part of a bigger application, Web service itself is an application that serves as a user interface for BlueCompute.
Deploying the Bluecompute App
To build and run the entire Bluecompute demo application, all the microservices must be spun up together. This is due to how we set up our Helm chart structure and how we dynamically produce our endpoints and URLs.
To run the web application properly with Istio, you must first enable Istio from values.yaml. Change the value of istio.enabled and istio.gateway.enabled to true in values.yaml, or alternatively use the --set flag with helm install to set the values for the helm deployment.
With Istio enabled, we can access the web application through the Istio ingress gateway. To find your Istio gateway port, run
kubectl get svc istio-ingressgateway -n istio-system
and look for the port mapped to 80, which should usually default to 31380. Use this together with your host IP (minikube ip or server ip).
Traffic Routing
When accessing the web application through the Istio gateway, try refreshing the page a few times. You should notice two different versions of the page with different color banners.
The traffic routing setup in the VirtualService in istio_web.yaml splits the traffic 50/50 between the latest and canary version of the web application when accessed through the Istio ingress gateway. These weights can be modified in the VirtualService.
Alternatively, you can target certain browsers for a specified version of the web application by using a match rule on user-agent headers (commented out in istio_web.yaml).
These are just a couple of examples for traffic routing using chosen weights or browsers. Many other methods of traffic routing may be applied, such as based on user identity, permissions, URL, or anything found in HTTP request headers.
About
This project is part of the 'IBM Cloud Native Reference Architecture for Kubernetes' suite