-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
False
-
-
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
- Deploy RHDH with the Orchestrator and Resource Optimization plugin
- Navigate to Cost Management > Optimizations
- Click "Apply Recommendations" on a workload (e.g., greeting, user-onboarding)
- Observe that the workflow reaches the LogSuccess state (patch succeeds)
- 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