Deploying Rating Engine

Deployment Overview

Rating Engine is deployed to a Kubernetes cluster and can be deployed to the cloud as well as on premises.

The Rating Engine APS application is deployed as a Docker container and includes the following components:

  • Rating Engine
  • Subscription History Management
  • Rating Adapter
  • Product Gateway

Installation Prerequisites

Kubernetes Resource Requirements

The minimum Kubernetes resources required for the microservice deployment, including on-premise Kubernetes cluster deployment, are:

Container CPU cores RAM in GiB
ratingengine-backend 1.0 1.4

Database Requirements

For CloudBlue Commerce database server resource requirements, see The Minimum Resource Requirements for the System Database Server.

Firewall Requirements

Please see Firewall Recommendations.

Installing or Upgrading Rating Engine

During Rating Engine installation or upgrade, zero downtime of CloudBlue Commerce is guaranteed. However, during upgrade, the related event processing is suspended; a special messaging service collects unprocessed events and, after the upgrade is complete, sends them to be processed by the upgraded Rating Engine service.

To install Rating Engine:

  1. Follow the common CloudBlue Commerce component deployment procedure using the Rating Engine deployment parameters below in the config.yaml.

    Note: By default, the latest version is installed.

  2. Make sure that the application is successfully installed:
    1. Go to CloudBlue Commerce Provider Control Panel (Operations) > Services > Applications.
    2. Make sure that the Rating Engine APS application is in the list.

Rating Engine Deployment and Configuration Parameters

When installing or updating Rating Engine using the common CloudBlue Commerce component deployment procedure, use the parameters below in the config.yaml.

Component Name

ratingengine-backend

Specific Parameters

Name Description Default Value Example
resources.requests.cpu Resource requirements 1  
resources.requests.memory Resource requirements 1280Mi  
resources.limits.cpu Resource requirements 1  
resources.limits.memory Resource requirements 1464Mi  
oauthkey

A randomly generated key. Can be generated using the uuidgen command.

Together with oauthsecret, oauthkey will be used by CloudBlue Commerce to generate a public key for Rating Engine to access the APS bus.

  d8d4656a-7b87-11e7-bb31-be2e44b06b36
oauthsecret

A randomly generated secret. Can be generated using the uuidgen command.

Together with oauthkey, oauthsecret will be used by CloudBlue Commerce to generate a public key for Rating Engine to access the APS bus.

  9e7050c2-0773-436b-bb33-b482cd225b8f
javaheapsize A parameter for JVM options (including Java heap size) -Xms512m -Xmx1024m -Xms512m -Xmx2g
dshost The Rating Engine database PostgreSQL instance hostname or IP address   rating.database.com
dslogin The user name to access the PostgreSQL database ratingengine ratinguser
dspassword

Base64-encoded password of the user defined by dslogin to access PostgreSQL.

To encode a password, use this command:

echo -n somepassword | base64

  VUNqc2RXM0cxdGNHMGE=
dsdbname The name of the Rating Engine APS application database ratingapp ratingapp
adapterdsdbname The name of the Rating Engine Adapter service module database adapter adapter
redsdbname The name of the Rating Engine service module database ratingengine ratingengine
smdsdbname The name of the Subscription History Management service module database subscription subscription
bssdshost The BSS database hostname or IP address   bss.database.com
bssdsdbname The BSS database name pba bssdatabase
bssdslogin The user login name to access the BSS database pba bssdbuserlogin
bssdspassword

Base64-encoded password of the user defined by bssdslogin to access the BSS database.

To encode a password, use this command:

echo -n somepassword | base64

  QkxMZDZvOWljc251MFI=
postgresbatchsize

This parameter defines how many subscriptions will be processed in one batch.

Important: Rating Engine Migrator tasks in OSS may fail with timeout because of postgresbatchsize. To avoid it, decrease the value of this parameter.

5000  
migratorplantaskgroupssize This parameter defines how many migration threads (and tasks) will be run at the same time. 4  
planspertask This parameter defines how many service plans will be processed within oneRating Engine Migrator tasks. 10  
migratorprecheckappnames

A comma-separated list of applications that must be prechecked before shifting subscriptions to Rating Engine.

Values:

  • [] (default): All installed applications will be prechecked.

  • <comma_separated_list>: a list of applications to be prechecked.

[]  
prmintegrationenabled This parameter defines where Rating Engine will obtain prices. If set to true, prices will be obtained from Price Manager, otherwise from BSS.   true
mindbpoolsize The minimum number of connections to each DB in the connections pool   1
maxdbpoolsize The maximum number of connections to each DB in the connections pool   64
durationprecision

The rounding precision for the duration of prorated billing periods (the number of decimal places after the decimal point)

Warning: durationprecision must have the same value as the BSS parameter DURATION_PRECISION.

2 2
migrator.skipBNOrders

This parameter defines whether the Shift to Rating Engine tool (Rating Engine Migrator) will skip BN orders when shifting subscriptions to Rating Engine. BN orders (also known as Not Invoiced Purchase orders) are an internal order type for backward compatibility with legacy services.

Values:

  • true: the Shift to Rating Engine tool (Rating Engine Migrator) will be skipping BN orders when shifting subscriptions to Rating Engine. The downtime will be reduced. For most installations, true should be used.

  • false (default): the Shift to Rating Engine tool (Rating Engine Migrator) will not be skipping BN orders when shifting subscriptions to Rating Engine. For special cases, false should be used.

false true
migrator.notification

This parameter defines whether notifications from the Shift to Rating Engine tool (Rating Engine Migrator) are displayed in the UX1 control panel. Values:

  • true (default): notifications from the Shift to Rating Engine tool are displayed in the UX1 for Providers UI.
  • false: notifications from the Shift to Rating Engine tool are not displayed in the UX1 for Providers UI. You can use it to reduce distraction of business users by technical messages. However, technical staff will not see them either.
true true

Sample config.yaml

Default config.yaml:

---
components:
  ratingengine-backend: {}

Related Topics

How to Obtain the Current config.yaml from CloudBlue Commerce

When updating CloudBlue Commerce components, you may need to obtain the current config.yaml.

To obtain the current config.yaml from CloudBlue Commerce, on a machine with kubectl, execute the following request:

kubectl -n NAMESPACE get secret config-yaml-backup -o "jsonpath={.data['config\.yaml']}" | base64 -d

Note: NAMESPACE is the namespace of your CloudBlue Commerce installation.
To find it, execute the following command:
kubectl describe svc oss-proxy | grep namespace

How to View the Deployment Parameters with Default Values for the Component Version You Want to Install (values.yaml)

To view the deployment parameters with default values (values.yaml) for the component version you want to install, run the following command from the machine with kubectl:

helm show values <component_name_for_config.yaml> --version <component_version> --username <username_for_deployment_repository> --password <username_for_deployment_repository> --repo <a_link_to_repository_with_CloudBlue Commerce_components>

For username and password to the deployment repository, please contact your Technical Account Manager.

Increasing Rating Engine Performance Through Automatic Scaling in Kubernetes

You can increase the performance of Rating Engine using the Kubernetes Horizontal Pod Autoscaler. To do it, enable the autoscaler using the following command:

kubectl autoscale deployment ratingengine-backend --cpu-percent=80 --min=1 --max=5

The command will create the following autoscale rule for the service:

If the service node is loaded over 80% then run another pod and distribute requests between pods; the minimum number of pods running at the same time is one; the maximum number of pods running at the same time is five.

To remove the autoscale rule, use the following command:

kubectl delete hpa ratingengine-backend

Kubernetes and Helm Commands for Troubleshooting

  • To check that a pod is running:

    kubectl get pods | grep ratingengine-backend | awk '{ print $3; }'
  • To obtain the kube-dns service IP address:

    kubectl get service --namespace kube-system | grep kube-dns | awk '{ print $3; };'
  • To obtain the logs from an executed POD:

    kubectl logs -f `kubectl get pods | grep ratingengine-backend | awk '{ print $1; }' | head -n 1`
  • To uninstall a pod:

    helm delete ratingengine-backend --purge
CloudBlue, an Ingram Micro business, uses cookies to improve the usability of our site. By continuing to use this site and/or logging in you are accepting the use of these cookies. For more information, visit our Privacy Policy.