ConfigureSettingsApply settings
Enable automatic deployment, configure the learning period, set optional thresholds to skip low-impact recommendations, and choose an apply method
4 minute read
How you configure Argo CD depends on which StormForge apply method you use:
The webhook apply methods are WebhookImmediateRollout, WebhookHybridRollout, and WebhookDeferredRollout.
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.
ignoreDifferences for HPAs and ScaledObjectsStormForge 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
RespectIgnoreDifferences disabledKeep 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.
The patch apply method is PatchImmediateRollout.
ignoreDifferences for workloads, HPAs, and ScaledObjectsStormForge 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.
RespectIgnoreDifferencesAdd 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.
With RespectIgnoreDifferences=true, some changes in Git aren’t applied (Argo CD issue #23283). With patch apply methods, this means:
metrics or a ScaledObject’s triggers in Git, the Application stays OutOfSync.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.