Scaling the OpenPages application server pod

You can scale the application server pod.

Before you begin

Review the minimum system requirements before you make changes. See System requirements.

About this task

For the OpenPages application server, you can:
  • Change the size of the instance, for example from Extra Small to Small.
  • If you're using the autoScaleConfig feature, set the minimum and maximum number of replicas to use.
  • Set the number of replicas to use.
  • Increase or decrease the number of vCPUs.
  • Increase or decrease the memory.
Tip: To check the current vCPUs and memory of the application server pod, run the following command:
oc describe sts/openpages-<instance_name>-sts
Note: Run scaling operations when the cluster is quiet.

Procedure

  1. Log in to your Red Hat® OpenShift® cluster as a instance administrator.
    ${CPDM_OC_LOGIN}
  2. Back up your OpenPages environment.
  3. Use one or more of the following options:

    For these commands, use the --tethered_instance_ns parameter if the OpenPages instance is installed in a tethered project.

    --cpd_instance_ns and --tethered_instance_ns are mutually exclusive, so you must specify either the --cpd_instance_ns parameter or --tethered_instance_ns parameter.

    Change the size of the instance
    You can use the scaleConfig parameter to change the size of an instance. For example, to change the size to xsmall, in the following command, replace ${size} with xsmall and run the command:
    oc -n ${INSTANCE_NAMESPACE} patch OpenPagesInstance ${INSTANCE_NAME} \
      --type=merge \
      --patch '{
        "spec": {
          "scaleConfig": "${size}",
            "metadata": 
             {
                "scaleConfig":"${size}"
             }
           }
         }'
    

    The scaleConfig parameter uses the values in Table 1, unless the customScaleConfig parameter is defined.

    Set the minimum and maximum number of application replicas
    If you're using auto-scaling, you can set the minimum and maximum replicas to use.
    oc -n ${INSTANCE_NAMESPACE} patch OpenPagesInstance ${INSTANCE_NAME}  \
      --type=merge \
      --patch "{\"spec\":{\"customScaleConfig\":{\"opapp\":{\"min_replicas\":1,\"max_replicas\":5}}}}"
    

    Use these parameters when you're using autoScaleConfig: true.

    Set the number of application replicas
    If you're using auto-scaling, the replicas parameter sets the initial number of replicas. The number of replicas in use scales up or down within the min_replicas and max_replicas range.

    If you're not using auto-scaling, the replicas parameter sets a fixed number of replicas to use.

    For example, to use two replicas, run the following command:
    oc -n ${INSTANCE_NAMESPACE} patch OpenPagesInstance ${INSTANCE_NAME}  \
      --type=merge \
      --patch "{\"spec\":{\"customScaleConfig\":{\"opapp\":{\"replicas\":2}}}}"
    
    Change the resources for the application pod
    You can change the resources for limits and requests. Change the cpu and memory parameters to set the resources.
    oc -n ${INSTANCE_NAMESPACE} patch OpenPagesInstance ${INSTANCE_NAME} \
      --type=merge \
      --patch "{\"spec\":{\"customScaleConfig\":{\"opapp\":{\"replicas\":2,\"resources\":{\"limits\":{\"cpu\":2,\"memory\":\"8Gi\",\"ephemeral-storage\":\"4Gi\"},\"requests\":{\"cpu\":\"5m\",\"memory\":\"8Gi\",\"ephemeral-storage\":\"4Gi\"}}}}}}"
    
    On a tethered namespace, you might receive the following error message:
    [ERROR] 2025-03-11T01:20:13.024803Z cmd.Run() failed with exit status 2
    [ERROR] 2025-03-11T01:20:13.024950Z Command exception: The update-cr command failed (exit status 2). You may find output and logs in the /root/cpd_cli_linux/cpd-cli-workspace/olm-utils-workspace/work directory.
    [ERROR] 2025-03-11T01:20:13.026910Z RunPluginCommand:Execution error:  exit status 1
    Apply the following patch as a workaround:
    oc -n ${PROJECT_CPD_INSTANCE_TETHERED} patch OpenPagesInstance ${INSTANCE_NAME}  \
      --type=merge \
      --patch '{
        "spec": {
          "customScaleConfig": {
            "opapp": {
              "replicas": 1,
              "resources": {
                "limits": {
                    "cpu": "4",
                    "ephemeral-storage":"4Gi",
                    "memory": "6Gi"
                },
                "requests": {
                    "cpu": "4",
                    "ephemeral-storage":"4Gi",
                    "memory": "6Gi"
                }
              }
            }
          }
        }
    }'

    For more information, see Setting and enforcing quotas.

    For example, if you're using auto-scaling:
    oc -n ${PROJECT_CPD_INSTANCE_TETHERED} patch OpenPagesInstance ${INSTANCE_NAME}  \
      --type=merge \
      --patch '{
        "spec": {
        "customScaleConfig": {
            "opapp": {
                "min_replicas": 1,
                "max_replicas": 5,
                "resources": {
                    "limits": {
                        "cpu": 4,
                        "memory": "6Gi"
                    },
                    "requests": {
                        "cpu": 4,
                        "memory": "6Gi"
                    }
                }
            }
        }
      }
    }'
    Or if you're not using auto-scaling:
    oc -n ${PROJECT_CPD_INSTANCE_TETHERED} patch OpenPagesInstance ${INSTANCE_NAME}  \
      --type=merge \
      --patch '{
        "spec": {
        "customScaleConfig": {
        "opapp": {
          "replicas": 2,
          "resources": {
            "limits": {
              "cpu": 4,
              "memory": "6Gi"
            },
            "requests": {
              "cpu": 4,
              "memory": "6Gi"
            }
          }
        }
      }
     }
    }'