Uploaded image for project: 'FlightPath'
  1. FlightPath
  2. FLPATH-3187

patch-k8s-resource workflow patches are reverted on operator-managed deployments

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      When the patch-k8s-resource workflow successfully patches resource limits/requests on a deployment managed by an operator (SonataFlow, Backstage, etc.), the operator's reconciliation loop immediately reverts the changes.

      Reproduction steps

      1. Deploy RHDH with the Orchestrator and Resource Optimization plugin
      2. Navigate to Cost Management > Optimizations
      3. Click "Apply Recommendations" on a workload (e.g., greeting, user-onboarding)
      4. Observe that the workflow reaches the LogSuccess state (patch succeeds)
      5. Check the deployment - resource changes have been reverted

      Root cause

      Most deployments in the rhdh-operator namespace are owned by Kubernetes operators:

      backstage-backstage: owned by Backstage CR
      greeting: owned by SonataFlow CR
      patch-k8s-resource: owned by SonataFlow CR
      user-onboarding: owned by SonataFlow CR
      sonataflow-platform-data-index-service: owned by SonataFlowPlatform CR
      

      These operators continuously reconcile their managed resources and revert any external modifications, including patches applied by the workflow.

      Verified behavior

      • Patches on operator-managed deployments (e.g., greeting) are applied but immediately reverted by the operator
      • Patches on non-operator-managed deployments (e.g., user-onboarding-server) persist correctly

      Expected behavior

      Resource optimization recommendations applied via the workflow should persist and not be reverted.

      Possible solutions

      • The workflow should patch the owning Custom Resource (e.g., SonataFlow CR) instead of the Deployment directly, so the operator reconciles with the updated values
      • Alternatively, the operator could be configured to not reconcile resource limits/requests
      • The plugin documentation should clarify that recommendations can only be applied to non-operator-managed workloads, or provide guidance on applying to operator-managed ones

              ydayagi yaron dayagi
              gharden1 Gary Harden
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: