Broadleaf Microservices

Infrastructure & DevOps

Prerequisite

Important

The following assumes you have obtained credentials outlined in the guide: Getting Started Locally and you have the ability to authenticate with Broadleaf’s docker registry.

e.g.

docker login repository.broadleafcommerce.com:5001

Infrastructure

Broadleaf runs on open source technologies and containers and as such can be run in most cloud infrastructures. Broadleaf can also be run in private data centers for customers that require more control of the infrastructure.

Broadleaf is built to be cloud-agnostic and has been deployed to a variety of clouds such as AWS, Azure, Alibaba, and Google Cloud.

It is most typical for our clients to utilize the framework to build Broadleaf-backed containerized services and deploy them to a managed cloud Kubernetes cluster alongside a cloud-managed relational database (e.g. postgres)

Having said that, the Broadleaf framework supports a variety of different pluggable backing technologies and can be deployed in a variety of configurations. See Tech Stack for more details.

Terraform

Broadleaf provides several Terraform modules that outline an opinionated infrastructure topology across common cloud providers and represent a good starting point for DevOps and Infra teams to use and incorporate into their own infrastructure landscape

Note
Please see the README on the "Terraform Starter" project that is included with the Microservice Project Starters on details around building out the necessary infrastructure needed to deploy a Broadleaf installation to your cloud of choice.

DevOps

CI/CD

When working with microservices, integration with a CI/CD workflow is an important step in ensuring a smooth SDLC proccess for both your developers as well as your ops team.

Broadleaf doesn’t prescribe specific CI/CD tooling but instead provides general guidance on some of the most common steps that would be needed to include the Broadleaf ecosystem into your organization’s workflow.

Setup Parameters

In general, you will want to first identify and parameterize these common resources (as well as any appropriate credentials):

General Dev/QA Build Steps for Java/Spring Boot Projects:

  • Authenticate with Broadleaf Microservices Nexus

  • Authenticate with your artifact registry

  • Login to Broadleaf’s Container Registry

  • Login to your Container Registry

  • Perform Maven Build (e.g. mvn deploy -DskipTests=true)

  • Push Jar Artifacts to your Registry

  • Logout of Broadleaf Repository

  • Logout of Azure Repository

  • Build Docker image (e.g. docker build --build-arg…​ or mvn clean package -Pdocker -Ddockerfile.tag=…​)

  • Push Docker image to your Container Registry

  • Logout of Broadleaf Registry

  • Logout of your artifact registry

Production Steps for Java/Spring Boot Projects:

  • everything above except we typically recommend using the mvn release plugin to tag versions and commit to source control

Dev/QA Build Steps for Node/React Projects:

  • Authenticate with Broadleaf Microservices NPM Repository

  • Install Node or use appropriate pipeline task equivalent

  • Install Yarn (e.g. yarn install --frozen-lockfile)

  • Build App (e.g. yarn build)

  • Test Coverage (e.g. yarn test:coverage)

  • Login to your container registry

  • Build Docker image (e.g. docker build)

  • Push Docker image to your container registry

  • Logout of your container registry

Production Steps for Node/React Projects:

  • Everything above except support for versioning: yarn version --new-version $(releaseVersion)

  • commit the new tag to source control

Helm Charts

Now that you have your own container images built and deployed to your own registry, you can now utilize our example Helm charts as a starter to deploy your various Broadleaf Flex Package compositions to an existing Kubernetes cluster (which can be created with the reference Terraform scripts mentioned above). See the Deployment Flexibility article for more details if you’re not familiar with Broadleaf’s Flex Package technology.

Note
Please see the README on the "Helm Charts Starter" project that is included with the Microservice Project Starters. This project provides a base starting point that you can use as a reference for your specific deployment as well as provides a sample install.sh script to deploy all the resources requirerd in a full Broadleaf installation containing all the demo starter images

Appendix: Demo Docker Images

The following tables describe the various demo images that are produced and used across the different Microservice Starter Projects. This serves as a general reference to their relative location within the starter Helm charts.

Note
typically the image tag versions defined in the starter project’s charts represent the latest stable releases of the current demo

Common Supporting Utility Services

Pod Primary Container Image Helm Chart

Backoffice Admin Gateway

repository.broadleafcommerce.com:5001/broadleaf/admingateway-monitored

blc-supporting-stack

Backoffice Admin

repository.broadleafcommerce.com:5001/broadleaf/adminweb

blc-supporting-stack

Auth Service

repository.broadleafcommerce.com:5001/broadleaf-demo/auth

blc-supporting-stack

Customer Facing Storefront Gateway

repository.broadleafcommerce.com:5001/broadleaf/commercegateway-monitored

blc-supporting-stack

Customer Facing Storefront

repository.broadleafcommerce.com:5001/broadleaf/commerce-nextjs-starter

blc-supporting-stack

Kafka

confluentinc/cp-kafka

blc-supporting-stack

Open API UI

repository.broadleafcommerce.com:5001/broadleaf/openapi-ui

blc-supporting-stack

Solr

repository.broadleafcommerce.com:5001/broadleaf/docker-solr

blc-supporting-stack

Zookeeper

confluentinc/cp-zookeeper

blc-supporting-stack

Optional Monitoring & Observability Stack

Name Typical Helm Installation Notes

Kube Prometheus Stack

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

kubectl apply -f kube-prometheus-stack/grafana/blc-dashboard-configmap.yaml

helm install -f kube-prometheus-stack/blc-values.yaml kube-prometheus-stack prometheus-community/kube-prometheus-stack --version 15.2.1

Typical Broadleaf overrides and settings can be found in: kube-prometheus-stack/blc-values.yaml along with an out-of-box Broadleaf Grafana dashboard (kubectl apply -f kube-prometheus-stack/grafana/blc-dashboard-configmap.yaml)

Elastic Stack

helm repo add elastic https://helm.elastic.co

helm install elasticsearch elastic/elasticsearch --version 7.11.2

helm install apm-server elastic-stack/apm-server

helm install -f elastic-stack/filebeat/blc-values.yaml filebeat elastic/filebeat

Sample APM Server and Filebeat config are located in elastic-stack/apm-server/values.yaml and elastic-stack/filebeat/blc-values.yaml


The following sections represent the different images used depending on which example flex package composition you choose to deploy for your core commerce backend services.

Min Flex Package Composition (good for development)

Pod Primary Container Image Helm Chart

Min - The Min Flex Package composes the following microservices together into a single deployment: Admin Navigation, Admin User, Metadata, Sandbox, Tenant, Search, Notification, Asset, Catalog Browse, Catalog, Personalization, Pricing, Offer, Campaign, Cart Ops, Cart, Customer, Inventory, Order Ops, Order, Vendor, Import, Scheduled Jobs, Menu

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-min-application

blc-min-flex-demo

Indexer - it is recommended that indexer be deployed independently of the other services in a min flex package composition.

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-indexer-application

blc-min-flex-demo

Pod Primary Container Image Helm Chart

browse - The Browse Flex Package composes the following microservices together: Asset, Catalog Browse, Catalog, Personalization, Pricing, Offer, Campaign, Vendor, Menu

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-browse-flex-application

blc-balanced-flex-demo

cart - The Cart Flex Package composes the following microservices together: Cart Ops, Cart, Customer, Inventory, Order Ops, Order

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-cart-flex-application

blc-balanced-flex-demo

processing - The Processing Flex Package composes the following microservices together: Import, Indexer, Scheduled Jobs, Campaign*, Catalog*, Customer*, Inventory*, Pricing*

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-processing-flex-application

blc-balanced-flex-demo

supporting - The Supporting Flex Package composes the following microservices together: Admin Navigation, Admin User, Metadata, Sandbox, Tenant, Search, Notification

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-supporting-flex-application

blc-balanced-flex-demo

Note
(*) The Processing Flex Package has some unique properties wherein some services are only included with input listeners for import and sandboxing transitions ONLY (and will be exempt from servicing typical request traffic). i.e. heavy back office functions can be scaled independently while not impacting customer facing browse flows or vice versa.

Granular Flex Package Composition

The following represents all the services deployed individually.

Image Helm Chart

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-adminnav-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-adminuser-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-asset-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-campaign-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-cart-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-cartops-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-catalog-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-catalogbrowse-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-customer-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-import-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-indexer-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-inventory-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-menu-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-metadata-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-notification-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-offer-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-order-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-orderops-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-personalization-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-pricing-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-sandbox-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-scheduledjob-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-search-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-tenant-application

blc-granular-flex-demo

repository.broadleafcommerce.com:5001/broadleaf-demo/demo-vendor-application

blc-granular-flex-demo