How to use StormForge and Argo CD together

Apply method and ignoreDifferences settings for using StormForge with Argo CD

How you configure Argo CD depends on which StormForge apply method you use:

  • Webhook apply methods (recommended): StormForge sets recommendations on Pods at admission time and doesn’t change the workload spec. Argo CD only needs to ignore StormForge’s changes to HPAs and ScaledObjects.
  • Patch apply methods: StormForge writes recommendations into the workload spec. Argo CD needs to ignore those changes and keep them when it syncs, which has some known issues.

Webhook apply methods

The webhook apply methods are WebhookImmediateRollout, WebhookHybridRollout, and WebhookDeferredRollout.

Set a webhook apply method as the default

Set StormForge’s default apply method to a webhook apply method. We recommend setting it in the defaults rule of your cluster-wide ClusterOptimizationConfiguration:

apiVersion: optimize.stormforge.io/v2
kind: ClusterOptimizationConfiguration
metadata:
  name: default-policy
spec:
  order: 10
  rules:
  - name: defaults
    settings:
    # ...your other default settings
    - name: apply.method
      value: WebhookImmediateRollout

See Configure optimization using CRDs for more on ClusterOptimizationConfigurations, and Apply method for the webhook apply methods and how to enable the webhook on the Applier.

Configure ignoreDifferences for HPAs and ScaledObjects

StormForge writes HPA target utilization directly to HPA spec.metrics and ScaledObject spec.triggers so that workloads keep scaling at the same load after their Pods are resized. Add ignoreDifferences rules for these to the argocd-cm ConfigMap so that Argo CD doesn’t treat StormForge’s changes as drift and revert them:

# argocd-cm ConfigMap
data:
  resource.customizations.ignoreDifferences.autoscaling_HorizontalPodAutoscaler: |
    jqPathExpressions:
    - .spec.metrics[].resource.target.averageUtilization
    - .spec.metrics[].containerResource.target.averageUtilization
  resource.customizations.ignoreDifferences.keda.sh_ScaledObject: |
    jqPathExpressions:
    - .spec.triggers[] | select((.type == "cpu" or .type == "memory") and .metricType == "Utilization") | .metadata.value

The rules apply to every Application, including ones added later.

To configure the rules per Application instead, add them to spec.ignoreDifferences in each Application that includes HPAs or ScaledObjects:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: <your-application>
  namespace: argocd
spec:
  ignoreDifferences:
  - group: autoscaling
    kind: HorizontalPodAutoscaler
    jqPathExpressions:
    - .spec.metrics[].resource.target.averageUtilization
    - .spec.metrics[].containerResource.target.averageUtilization
  - group: keda.sh
    kind: ScaledObject
    jqPathExpressions:
    - .spec.triggers[] | select((.type == "cpu" or .type == "memory") and .metricType == "Utilization") | .metadata.value

Keep RespectIgnoreDifferences disabled

Keep RespectIgnoreDifferences at its default of false for Applications that manage HPAs or ScaledObjects:

spec:
  syncPolicy:
    syncOptions:
    - RespectIgnoreDifferences=false

With this option enabled, Argo CD keeps the HPA’s whole live metrics list, or the ScaledObject’s whole live triggers list, when it syncs, so changes to those lists in Git are never applied. See Argo CD issue #23283.

Patch apply methods

The patch apply method is PatchImmediateRollout.

Configure ignoreDifferences for workloads, HPAs, and ScaledObjects

StormForge writes recommendations to the workload spec and to HPA and ScaledObject targets. Add ignoreDifferences rules for both to the argocd-cm ConfigMap:

# argocd-cm ConfigMap
data:
  # Workload resource kinds
  resource.customizations.ignoreDifferences.apps_Deployment: |
    managedFieldsManagers:
    - stormforge
  resource.customizations.ignoreDifferences.apps_StatefulSet: |
    managedFieldsManagers:
    - stormforge
  resource.customizations.ignoreDifferences.apps_DaemonSet: |
    managedFieldsManagers:
    - stormforge

  # Autoscaler resource kinds
  resource.customizations.ignoreDifferences.autoscaling_HorizontalPodAutoscaler: |
    jqPathExpressions:
    - .spec.metrics[].resource.target.averageUtilization
    - .spec.metrics[].containerResource.target.averageUtilization
  resource.customizations.ignoreDifferences.keda.sh_ScaledObject: |
    jqPathExpressions:
    - .spec.triggers[] | select((.type == "cpu" or .type == "memory") and .metricType == "Utilization") | .metadata.value

The HPA and ScaledObject rules are the same as for webhook apply methods. Don’t use resource.customizations.ignoreDifferences.all. The managedFieldsManagers rule is for workload kinds only.

Enable RespectIgnoreDifferences

Add RespectIgnoreDifferences=true to each Application’s sync options:

spec:
  syncPolicy:
    syncOptions:
    - RespectIgnoreDifferences=true

Without it, Argo CD overwrites StormForge’s values with the values in Git each time it syncs. With it, changes in Git to a workload’s container resources aren’t applied while StormForge manages that workload.

Known issues

With RespectIgnoreDifferences=true, some changes in Git aren’t applied (Argo CD issue #23283). With patch apply methods, this means:

  • HPA and ScaledObject metric changes in Git aren’t applied. When you change an HPA’s metrics or a ScaledObject’s triggers in Git, the Application stays OutOfSync.
  • Argo Rollouts container changes in Git aren’t applied. Argo CD keeps the Rollout’s live containers list, so image and other container changes in Git don’t roll out. Without an ignore rule for Rollouts, Argo CD reverts StormForge’s changes instead.

To avoid both, use a webhook apply method, either as the default or only for affected workloads: Argo Rollouts and workloads with an HPA or ScaledObject.

Last modified November 5, 2026