cryostat-operator
cryostat-operator copied to clipboard
Cryostat Operator on Openshift on AWS fail to create an instance
On Openshift 4.11.8, running on AWS, i can't deploy an instance of cryostat with cryostat operator version 2.2.1. With the following yaml (which is the default one basically):
apiVersion: operator.cryostat.io/v1beta1
kind: Cryostat
metadata:
finalizers:
- operator.cryostat.io/cryostat.finalizer
spec:
enableCertManager: true
minimal: false
reportOptions:
resources: {}
storageOptions:
emptyDir:
enabled: true
I always get this error: (combined from similar events): Error creating: Pod "cryostat-sample2-7ccf79d9f-j8rvf" is invalid: spec.containers[1].resources.requests: Invalid value: "1": must be less than or equal to cpu limit
Hi @mcombi, is a Limit Range defined for this namespace that is setting the CPU limit?
I know that the out format it's pretty weird but here it is oc describe limits -n matteo-test Name: matteo-test-core-resource-limits Namespace: matteo-test Type Resource Min Max Default Request Default Limit Max Limit/Request Ratio
Container cpu - 4 50m 500m - Container memory - 6Gi 256Mi 1536Mi - Pod cpu - 4 - - - Pod memory - 12Gi - - -
Thanks @mcombi, so if I'm reading correctly, the containers all receive a default limit of 500m
, but this can be increased. Perhaps it's worthwhile for our operator to query Limit Ranges in the namespace when setting a default resource request for our containers, although there are low defaults we couldn't accommodate. We could also consider lowering the default CPU request for the Grafana container (currently 1 CPU).
Fortunately, it should be easy to make this work in your setup. The Cryostat custom resource has properties to specify resource requests and limits for each container. Try editing the Cryostat custom resource YAML as follows:
apiVersion: operator.cryostat.io/v1beta1
kind: Cryostat
metadata:
finalizers:
- operator.cryostat.io/cryostat.finalizer
spec:
enableCertManager: true
minimal: false
reportOptions:
resources: {}
storageOptions:
emptyDir:
enabled: true
resources:
grafanaResources:
limits:
cpu: 1000m
This should re-create the affected container with CPU requests and limits of 1.
Hi @ebaron , thanks for your reply. Following your suggestion the deployment is fine. An option could be, as you mentioned to query limits range and/or propose or highlight the minimum required resources. My env is probably quite small, but it is the one we usully use for demoing features and probably have some specific limitation in order to contain costs.
Thanks for your support