Deploying the Loyalty Program Microservice
Prerequisites
- For consistent calculations, billing period rounding precision is set to the same number of digits after the decimal point for Rating Engine and for Billing.
- A PostgreSQL database for Loyalty Program is deployed.
Deploying a PostgreSQL Database for Loyalty Program
To create a Loyalty Program database:
- On a PostgreSQL instance, create a database.
-
Create a secret in Kubernetes with the name "loyalty-program-db". The secret file must contain the database credentials, for example:
{ "apiVersion": "v1", ... "data": { "dbname": "bG95YWx0eS1wcm9ncmFt", "host": "ZGItcG9zdGdyZXNxbA==", "password": "cXp1dmVBa0V0MnYyV1VNYQ==", "username": "bG95YWx0eS1wcm9ncmFt" } ... }
Deploying Loyalty Program
To deploy Loyalty Program:
- Ensure the prerequisites.
- Follow the common CloudBlue Commerce component deployment procedure using the deployment parameters below in the config.yaml.
Upgrading Loyalty Program
To upgrade Loyalty Program to the latest version, use the deployment parameters below and follow Upgrading Components.
Loyalty Program Deployment Parameters
When installing or updatingLoyalty Program, use the parameters below in config.yaml.
Component Name
loyalty-program
Common Parameters
Parameter | Default value |
---|---|
components.loyalty-program.javaopts | -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=256m -XX:InitialRAMPercentage=30.0 -XX:MaxRAMPercentage=70.0 |
components.loyalty-program.jdbcconnectionparams | ?sslmode=disable&ApplicationName=loyalty-program |
components.loyalty-program.db_secret | loyalty-program-db |
components.loyalty-program.resources.requests.cpu | 1000m |
components.loyalty-program.resources.requests.memory | 1Gi |
components.loyalty-program.resources.limits.cpu | 4000m |
components.loyalty-program.resources.limits.memory | 4Gi |
components.loyalty-program.mindbpoolsize | 1 |
components.loyalty-program.maxdbpoolsize | 16 |
Specific Parameters
Parameter | Default value | Description |
---|---|---|
components.loyalty-program.aps_max_post_size | 100000000L | The maximum size of a REST request in bytes. |
Sample config.yaml
Default:
--- components: loyalty-program: {}
For large orders:
--- components: loyalty-program: aps_max_post_size: 300000000L
Full config.yaml:
--- components: loyalty-program: oauthkey: 7d69aaf7-35af-49dd-bf89-e679c0cacbf2 oauthsecret: 2840de45-378c-436b-ab48-e57b2fa09885 javaopts: -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=256m -XX:InitialRAMPercentage=30.0 -XX:MaxRAMPercentage=70.0 devmode: enabled: false resources: requests: cpu: 1000m memory: 1Gi limits: cpu: 4000m memory: 4Gi db_secret: loyalty-program-db mindbpoolsize: 1 maxdbpoolsize: 16 jdbcconnectionparams: ?sslmode=disable&ApplicationName=loyalty-program alerts_enabled: false aps_max_post_size: 100000000L
Default parameter values:
--- jdbcconnectionparams: ?sslmode=disable&ApplicationName=loyalty-program resources: requests: cpu: 1000m memory: 1Gi limits: cpu: 4000m memory: 4Gi aps_max_post_size: 100000000L
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.