Optimizing Custom (CRD) Workload Types

StormForge Optimize Live supports standard built-in Kubernetes workload types out of the box, such as Deployments, StatefulSets, and DaemonSets. It also includes support for common third-party workload types like ArgoRollouts.

In addition to using built-in workload types, many organizations use Custom Resource Definitions (CRDs) to define their workloads. These might be:

  • Third-party Operators: such as the GitHub Actions Runner Controller (ARC) or SparkApplications.
  • In-house Workload CRDs: unique to your organization’s platform.

If your CRD represents the workload itself, you can configure StormForge to recognize and optimize it using the workloadResourceTypes Helm parameter. StormForge can recognize any CRD as a workload type as long as it meets the following requirements:

Configuration

To support a custom workload type, you must provide StormForge with:

  1. Identification: The API Group and Kind of the resource.
  2. CRD Patch Paths: Tell StormForge about specific CRD fields that it might need to update.

This configuration is applied via the StormForge Agent’s Helm values.

Helm Parameter: workloadResourceTypes

The workloadResourceTypes parameter is a list of objects with the following fields:

Field Description Required
group The API group of the CRD (e.g., actions.github.com). Yes
kind The Kind of the CRD (e.g., AutoscalingRunnerSet). Yes
resource The API resource name (e.g., autoscalingrunnersets). Yes
patchTargetTypeDefaults (Map) Default patch paths. Required if you want to patch this workload type. Conditional

Patch Target Type Defaults

StormForge uses “Patch Paths” to know which fields in your CRD’s YAML to update when performing various optimization operations.

Common keys for patchTargetTypeDefaults:

  • live.stormforge.io/containers.cpu.requests.patch-path
  • live.stormforge.io/containers.cpu.limits.patch-path
  • live.stormforge.io/containers.memory.requests.patch-path
  • live.stormforge.io/containers.memory.limits.patch-path

Patch path values are Go templates that will be resolved to JSON pointers, with some extensions. For information on how to define Patch Path settings for your CRD, please contact StormForge support.

Example: GitHub Actions Runner Controller (ARC)

Suppose you are running GitHub Actions Runners using the Actions Runner Controller and you want to optimize the AutoscalingRunnerSet resource.

Accessing the memory and CPU requests involves navigating the spec to find the container template.

Example values.yaml

workloadResourceTypes:
- group: actions.github.com
  kind: AutoscalingRunnerSet
  resource: autoscalingrunnersets
  # Configuration values for patch paths will depend on the structure of your
  # CRD. For AutoscalingRunnerSet, the pod template is within the spec.
  patchTargetTypeDefaults:
    # This path allows StormForge to rollout/restart the workload when
    # recommendations are applied.
    live.stormforge.io/pod-template.metadata.patch-path: >
      /spec/template/metadata
    # These paths let StormForge patch the container resources on the CRD
    # workload definition itself. These paths are not required if you are using
    # the webhook to patch pods on admission.
    live.stormforge.io/containers.cpu.requests.patch-path: >
      /spec/template/spec/containers/[name={{ .ContainerName }}]/resources/requests/cpu
    live.stormforge.io/containers.cpu.limits.patch-path: >
      /spec/template/spec/containers/[name={{ .ContainerName }}]/resources/limits/cpu
    live.stormforge.io/containers.memory.requests.patch-path: >
      /spec/template/spec/containers/[name={{ .ContainerName }}]/resources/requests/memory
    live.stormforge.io/containers.memory.limits.patch-path: >
      /spec/template/spec/containers/[name={{ .ContainerName }}]/resources/limits/memory

How It Works

  1. Discovery: The StormForge Agent watches for resources matching the configured Group and Kind.
  2. Recognition: When found, these resources are treated as Workloads.
  3. Optimization: StormForge analyzes workload usage metrics and generates recommendations.
  4. Patching: When a recommendation is applied, StormForge generates one or more patches. Different apply methods will result in different kinds of patches being generated.
Last modified January 14, 2026