manage apply-hpa-config

Update the horizontal pod autoscaling (HPA) configuration for the specified components.

Required role
Instance administrator An instance administrator can run this command.

Extended description

You can use the apply-hpa-config command to enable or disable automatic scaling. Automatic scaling uses the Red Hat® OpenShift® Container Platform horizontal pod autoscaler to automatically increase or decrease the number of pods in response to CPU or memory consumption.

Not all services support automatic scaling. For information about which services support automatic scaling, see Automatically scaling resources for services.

Syntax

cpd-cli manage apply-hpa-config \
--cpd_instance_ns=<project-name> \
--components=<comma-separated-list-of-component-names> \
--enable_hpa=true|false \
[--wait=true|false] \
[--param-file=tmp/work/<file-name>]

Arguments

The apply-hpa-config command has no arguments.

Options

Table 1: Command options
Option Description
--components The component or components for which you want to change the HPA configuration.
Status
Required.
Syntax
--components=<comma-separated-list-of-component-names>
Default value
There is no default value. The list depends on which components you want to scale.
Valid values
For the list of components, see Component IDs.
You can specify individual components or a comma-separated list of components.
Restriction: Not all services support automatic scaling. For information about which services support automatic scaling, see Automatically scaling resources for services.
--cpd_instance_ns The project (namespace) where the components for which you want to change the HPA configuration are installed.
Status
Required.
Syntax
--cpd_instance_ns=<project-name>
Default value
No default. User-defined.
Valid values
The name of an existing project on the Red Hat OpenShift Container Platform cluster.
--enable_hpa Specify whether to enable horizontal pod autoscaling.
Status
Required.
Syntax
--enable_hpa=true|false
Default value
No default.
Valid values
false
Disable automatic scaling.
true
Enable automatic scaling.
--param-file The name of a YAML file that includes additional parameters.

Use this option to override the default custom resource name for components that support multiple instances.

This option applies only to the following components:
  • OpenPages service instances (component ID: openpages_instance)
  • Watson OpenScale: (component ID: openscale)
  • Product Master service instances (component ID: productmaster_instance)
Create a file with the following format:
override_components_meta:
   <component-ID>:
      cr_name: <cr-name>

The file must be in the work directory on the client workstation.

Status
Optional.
Syntax
--param-file=tmp/work/<file-name>
Default value
No default. User-defined.
Valid values
The name of a YAML file that includes additional parameters.
--wait Specify whether to wait for the custom resource to be ready.
Status
Optional.
Syntax
--wait=true|false
Default value
true

If you omit this option, the default value is used.

Valid values
false
Return to the command prompt without waiting for the custom resource to be ready.
true
Wait for the custom resource to be ready.

Examples

Note: The following example uses the recommended installation environment variables.

It is strongly recommended that you use a script to create environment variables with the correct values for your environment. For details, see Setting up installation environment variables.

Enable automatic scaling the Decision Optimization service
cpd-cli manage apply-hpa-config \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=dods \
--enable_hpa=true
Disable automatic scaling the Orchestration Pipelines service
cpd-cli manage apply-hpa-config \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=ws_pipelines \
--enable_hpa=false