Optimizing resource usage with IBM Turbonomic

IBM Turbonomic can be used to optimize the usage of resources by your deployments. Turbonomic is an AI-powered solution that continuously analyzes workload demand and automates CPU and memory adjustments to keep applications performant and cost-efficient.

Before you begin

Turbonomic connects to your cluster through Kubeturbo, an agent that collects real-time resource metrics and reports them to Turbonomic for optimization analysis. To use Turbonomic, install and configure the IBM Turbonomic Platform operator and connect your cluster as a target. For more information, see the IBM Turbonomic documentation External link opens a new window or tab. The following procedure assumes Turbonomic is installed and Kubeturbo is reporting cluster data.

Note: Currently, installation of Turbonomic on Kubernetes clusters is supported on the Red Hat OpenShift platform, AWS Elastic Kubernetes Service (EKS), Google Kubernetes Engine (GKE), and Azure Kubernetes Service (AKS). It is possible to install on any upstream compliant Kubernetes, but your Turbonomic representative might not be able to provide support.

About this task

Your deployments are managed by the operators through custom resources (CRs). If resource values are changed directly on a deployment, the operator reverts them during its next reconciliation. For this reason, Turbonomic does not modify the deployment directly. Instead, it uses Operator Resource Mappings (ORMs) to write recommended resource values into the corresponding CR, and the operator then reconciles the values to the pods.

For IBM® Content Cortex deployments, Turbonomic supports optimization for both the Content operator and the Content Cortex AI Services operator.

Two prerequisites are specific to your deployment and are not covered by the Turbonomic documentation:

  • Content Cortex deployment custom resources do not include a resources parameter by default. Because Turbonomic can update only the fields that exist, you must add an empty resources: {} block to each component section you want optimized before you apply any ORM.

  • Turbonomic must be granted access to write to your deployment CRs. Grant access by adding the relevant API groups and resource kinds to the ormOwners section of the Kubeturbo CR.

Procedure

  1. Add an empty resources: {} block to each component section in your deployment CR that you want Turbonomic to manage.

    For example, the following CR has resources: {} parameters for the Content components cpe and css, and Navigator.

    spec:
      ecm_configuration:
        cpe:
          resources: {} 
        css:
          resources: {}
      navigator_configuration:
        resources: {}
  2. Grant Turbonomic access to the custom resources. Update the ormOwners in the Kubeturbo CR with the API groups and resource kinds.

    The following example shows the API groups (fncm.ibm.com and icp4a.ibm.com) and the resource kinds (fncmclusters, and ccxaiservices) in the Kubeturbo CR.

    spec:
      ormOwners:
        apiGroup:
         - fncm.ibm.com
         - icp4a.ibm.com
        resources:
         - fncmclusters
         - ccxaiservices
  3. Update the Kubeturbo role in the custom resource (CR).

    Change the Kubeturbo CR role parameter from turbo-cluster-admin to cluster-admin.

    role: cluster-admin        
  4. Apply the ORM definitions for the components.

    The ORM files are available in the ibm-content-cortex-containers repository under the descriptors/content-cortex/turbonomics/ folder. Apply the ORMs after making necessary changes to the template.

    cd ibm-content-cortex-containers/descriptors/content-cortex/turbonomics
    oc apply -f . -n <namespace>
  5. In the Turbonomic user interface, click Settings > Target Configuration, select the Kubeturbo target, and click Rediscover so that Kubeturbo discovers the newly applied ORMs.
  6. Verify that each ORM is recognized and its mapped resources are found in the cluster by running the following command.
    oc get orm -n <namespace> <orm-name> -o yaml

    The status section reports whether the capabilities defined in the ORM are matched in the cluster. If all the configurations are correct, the status returns an ok state without any errors.

Results

Turbonomic analyzes workload resource utilization and generates resize actions to optimize resource allocation. When these actions are executed, Turbonomic writes the recommended CPU and memory adjustments to the custom resources (CRs) rather than directly to the underlying deployments. The operators then reconcile the updated CRs and apply the revised resource allocations to the running pods.

What to do next

If you no longer want Turbonomic to manage resources through Operator Resource Mappings (ORM), you can remove the ORM from the cluster.