Description
Bug Report
There are three pods in our multi- cluster subscription community operator https://github.com/operator-framework/community-operators/tree/master/community-operators/multicluster-operators-subscription
Though a selector is set to match 2 of 3 pods in the operator subscription CR, the resource limit is applied to all of the 3 pods.
To reproduce it:
-
go to openshift operator Hub web console, install the community operator
Multicluster Subscription Operator V0.2.3
in a namespace. e.g.open-cluster-management
-
Make sure the 3 pods with different labels are installed. Also no resource limit is applied to the 3 pods.
% oc get pods -l "app in (multicluster-operators-standalone-subscription, multicluster-operators-hub-subscription, multicluster-operators-application)"
NAME READY STATUS RESTARTS AGE
multicluster-operators-application-585d76cd-9p5ht 4/4 Running 0 7m32s
multicluster-operators-hub-subscription-84b776d654-pmmjp 1/1 Running 0 7m32s
multicluster-operators-standalone-subscription-868b55fdbc-dmsct 1/1 Running 0 7m32s
% oc get pods multicluster-operators-standalone-subscription-7c8cbf885f-tjpb8 -o yaml
apiVersion: v1
kind: Pod
spec:
containers:
- image: quay.io/open-cluster-management/multicluster-operators-subscription:community-2.1
resources: {}
status:
qosClass: BestEffort
- Apply the new operator subscription CR,
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: multicluster-operators-subscription
namespace: open-cluster-management
spec:
channel: release-2.1
config:
selector:
matchExpressions:
- key: app
operator: In
values:
- multicluster-operators-standalone-subscription
- multicluster-operators-hub-subscription
resources:
limits:
cpu: 750m
memory: 2Gi
requests:
cpu: 150m
memory: 128Mi
installPlanApproval: Automatic
name: multicluster-operators-subscription
source: community-operators
sourceNamespace: openshift-marketplace
startingCSV: multicluster-operators-subscription.v0.2.3
- Expected result.
The resource limit is applied to the two pods - multicluster-operators-standalone-subscription
and multicluster-operators-hub-subscription
The pod multicluster-operators-application
should have no resource limit
- Actual result
The resource limit is applied to all the three pods, including multicluster-operators-application
% oc get pods multicluster-operators-application-585d76cd-96drh -o yaml
apiVersion: v1
kind: Pod
spec:
containers:
- image: quay.io/open-cluster-management/multicluster-operators-placementrule:community-2.1
resources:
limits:
cpu: 750m
memory: 2Gi
requests:
cpu: 150m
memory: 128Mi
...
status:
qosClass: Burstable
Environment
OCP V4.5.6 built-in OLM
Suggested Solution
- In our multicluster subscription operator CSV, we have defined different resource limits for each container in each pod. It seems to be ignored by OLM. Is there a specific reason for that?
It would be great if OLM could support to set container resource limits through operator CSV directly, which is consistent with k8s deployment api specification.
- If OLM only hopes to set resource limit though operator subscription CR, one generic solution would be to support multiple pod selectors, and resource is defined under each selector. As a result, different resource limit/request can be applied to all containers in different pods decided by the pods selector.