Bug 1927806 - Document current total Custom Resource Definition limit of 250 before throttling starts to occur
Summary: Document current total Custom Resource Definition limit of 250 before throttl...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 4.7
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: 4.7.z
Assignee: Samantha Gidlow
QA Contact: Ke Wang
Latha S
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-11 15:18 UTC by Mike Fiedler
Modified: 2024-06-14 00:15 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-21 18:00:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1899575 1 high CLOSED update discovery burst to reflect lots of CRDs on openshift clusters 2024-10-01 17:06:30 UTC

Description Mike Fiedler 2021-02-11 15:18:39 UTC
Document URL: 

https://docs.openshift.com/container-platform/4.6/scalability_and_performance/planning-your-environment-according-to-object-maximums.html

Section Number and Name: 

Planning your environment according to object maximums

Describe the issue: 

OpenShift 4.7 and 4.6.z have a limit of 250 total Custom Resource Definitions, including those installed by OpenShift, products integrating with OpenShift and user created CRDs.   If more than 250 CRDs are created, there is a possibility that oc command requests will be throttled.

@mszulik can provide more info from the engineering side.

Comment 7 Ke Wang 2022-03-18 09:03:53 UTC
I did a test against OCP 4.7, it seems we have a better performance, I increased the limit of total Custom Resource Definitions to 512+. 

$ oc version -o yaml
clientVersion:
  buildDate: "2022-03-12T05:42:50Z"
  compiler: gc
  gitCommit: c4ebc7adea655be4dab6dcb421d16367ca034130
  gitTreeState: clean
  gitVersion: 4.7.0-202203120156.p0.gc4ebc7a.assembly.stream-c4ebc7a
  goVersion: go1.15.14
  major: ""
  minor: ""
  platform: linux/amd64
openshiftVersion: 4.7.0-0.nightly-2022-03-16-113339
releaseClientVersion: 4.7.0-0.nightly-2022-03-16-113339
serverVersion:
  buildDate: "2022-03-09T15:52:32Z"
  compiler: gc
  gitCommit: e0c0acdd26f125af791fc0f8315f8304d4a62980
  gitTreeState: clean
  gitVersion: v1.20.14+0d60930
  goVersion: go1.15.14
  major: "1"
  minor: "20"
  platform: linux/amd64

$ cat test-crd.yaml 
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: testcrs.example.com
spec:
  group: example.com
  names:
    kind: TestCR
    plural: testcrs
  scope: Namespaced
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            a:
              type: string
  version: v1
  versions:
  - name: v1
    served: true
    storage: true

$ for j in {1..450}; do sed "s/testcrs/testcrs-$j/" test-crd.yaml | oc create -f - -n test1; done
...
W0318 16:55:17.793590   52376 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
customresourcedefinition.apiextensions.k8s.io/testcrs-450.example.com created

$ oc get crds |wc -l
547

Made some sanity checks,

$ oc get all -n default
NAME                 TYPE           CLUSTER-IP   EXTERNAL-IP                            PORT(S)   AGE
service/kubernetes   ClusterIP      172.30.0.1   <none>                                 443/TCP   66m

$ oc get co
NAME                                       VERSION                             AVAILABLE   PROGRESSING   DEGRADED   SINCE
authentication                             4.7.0-0.nightly-2022-03-16-113339   True        False         False      40m
baremetal                                  4.7.0-0.nightly-2022-03-16-113339   True        False         False      58m
cloud-credential                           4.7.0-0.nightly-2022-03-16-113339   True        False         False      63m
cluster-autoscaler                         4.7.0-0.nightly-2022-03-16-113339   True        False         False      59m
config-operator                            4.7.0-0.nightly-2022-03-16-113339   True        False         False      61m
console                                    4.7.0-0.nightly-2022-03-16-113339   True        False         False      47m
csi-snapshot-controller                    4.7.0-0.nightly-2022-03-16-113339   True        False         False      60m
dns                                        4.7.0-0.nightly-2022-03-16-113339   True        False         False      59m
etcd                                       4.7.0-0.nightly-2022-03-16-113339   True        False         False      59m
image-registry                             4.7.0-0.nightly-2022-03-16-113339   True        False         False      52m
ingress                                    4.7.0-0.nightly-2022-03-16-113339   True        False         False      52m
insights                                   4.7.0-0.nightly-2022-03-16-113339   True        False         False      54m
kube-apiserver                             4.7.0-0.nightly-2022-03-16-113339   True        False         False      58m
kube-controller-manager                    4.7.0-0.nightly-2022-03-16-113339   True        False         False      58m
kube-scheduler                             4.7.0-0.nightly-2022-03-16-113339   True        False         False      58m
kube-storage-version-migrator              4.7.0-0.nightly-2022-03-16-113339   True        False         False      51m
machine-api                                4.7.0-0.nightly-2022-03-16-113339   True        False         False      50m
machine-approver                           4.7.0-0.nightly-2022-03-16-113339   True        False         False      60m
machine-config                             4.7.0-0.nightly-2022-03-16-113339   True        False         False      59m
marketplace                                4.7.0-0.nightly-2022-03-16-113339   True        False         False      59m
monitoring                                 4.7.0-0.nightly-2022-03-16-113339   True        False         False      50m
network                                    4.7.0-0.nightly-2022-03-16-113339   True        False         False      60m
node-tuning                                4.7.0-0.nightly-2022-03-16-113339   True        False         False      60m
openshift-apiserver                        4.7.0-0.nightly-2022-03-16-113339   True        False         False      53m
openshift-controller-manager               4.7.0-0.nightly-2022-03-16-113339   True        False         False      58m
openshift-samples                          4.7.0-0.nightly-2022-03-16-113339   True        False         False      53m
operator-lifecycle-manager                 4.7.0-0.nightly-2022-03-16-113339   True        False         False      60m
operator-lifecycle-manager-catalog         4.7.0-0.nightly-2022-03-16-113339   True        False         False      60m
operator-lifecycle-manager-packageserver   4.7.0-0.nightly-2022-03-16-113339   True        False         False      54m
service-ca                                 4.7.0-0.nightly-2022-03-16-113339   True        False         False      61m
storage                                    4.7.0-0.nightly-2022-03-16-113339   True        False         False      60m

everything is well, I don't know exactly what the maximum limit is, giving limit 512 is good choice.

Comment 9 Ke Wang 2022-03-21 08:30:20 UTC
Limit 512 works fine for OCP 4.8, 4.9 and 4.10, I tested.

Comment 10 Ke Wang 2022-03-21 08:32:02 UTC
Test CRD for 4.9 and later.

$ cat test-crd.yaml 
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: testcrs.example.com
spec:
  group: example.com
  names:
    kind: TestCR
    plural: testcrs
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        properties:
          spec:
            properties:
              a:
                type: string
            type: object
        type: object
    served: true
    storage: true


Note You need to log in before you can comment on or make changes to this bug.