Bug 2028250 - Multiple CatalogSources causing higher CPU use than necessary
Summary: Multiple CatalogSources causing higher CPU use than necessary
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Telco Edge
Version: 4.10
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.9.z
Assignee: Ian Miller
QA Contact: yliu1
URL:
Whiteboard:
Depends On: 2028240
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-01 19:26 UTC by OpenShift BugZilla Robot
Modified: 2022-03-02 18:53 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-23 20:02:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift-kni cnf-features-deploy pull 826 0 None open [release-4.9] Bug 2028250: ztp: Use common CatalogSource for all subscriptions 2022-01-07 15:56:44 UTC
Github openshift-kni cnf-features-deploy pull 919 0 None open [release-4.9] ztp: add default catsrc to source crs 2022-01-21 18:22:57 UTC
Red Hat Product Errata RHSA-2022:0561 0 None None None 2022-02-23 20:03:43 UTC

Description OpenShift BugZilla Robot 2021-12-01 19:26:56 UTC
+++ This bug was initially created as a clone of Bug #2028240 +++

Description of problem:
The reference ZTP configuration uses a separate CatalogSource for each operator subscription. These operators will all be in the same disconnected registry in the target use case, and are all contained in the redhat-operators registry in connected environments. Using a single CatalogSource for all operators reduces CPU use by olm indexing and liveness/readiness probes.

Version-Release number of selected component (if applicable): 4.10


How reproducible: Always


Steps to Reproduce:
1. oc get CatalogSource -A on ZTP installed system

Actual results:
5 CatalogSources are reported


Expected results: 1 CatalogSource


Additional info:

Comment 3 yliu1 2022-01-21 18:12:09 UTC
Verification with v4.9.0-18 ztp-site-generator container image. 
Looks like example is updated, but referenced source-crs are not added to release-4.9 branch:
https://github.com/openshift-kni/cnf-features-deploy/blob/release-4.9/ztp/gitops-subscriptions/argocd/resource-hook-example/policygentemplates/common-ranGen.yaml#L62

Does not have it in source-crs:
https://github.com/openshift-kni/cnf-features-deploy/commits/release-4.9/ztp/source-crs


# Error syncing policies app:

ztp-hooks.watcher 2022-01-21 18:03:52 UTC [DEBUG]             [watcher:135]: Objects to delete are: ['group-du-sno', 'worker-2', 'common']
ztp-hooks.watcher 2022-01-21 18:03:52 UTC [DEBUG]             [watcher:136]: Objects to create/update are: []
ztp-hooks.watcher 2022-01-21 18:03:52 UTC [DEBUG]             [watcher:150]: No objects to update
ztp-hooks.watcher 2022-01-21 18:03:52 UTC [ERROR]             [watcher:85]: PolicyGenWrapper failed: Manifest conversion failed: 2022/01/21 18:03:52 Could not build the entire policy defined by tmpey1hlgod: open /tmp/ztp/source-crs/DefaultCatsrc.yaml: no such file or directory
panic: open /tmp/ztp/source-crs/DefaultCatsrc.yaml: no such file or directory

goroutine 1 [running]:
main.InitiatePolicyGen(0x7ffc5eb0e6fc, 0x17, 0x7ffc5eb0e714, 0x13, 0x7ffc5eb0e728, 0x17, 0xc000100000)
	/go/src/cnf-features-deploy/app/ztp/ztp-policy-generator/kustomize/plugin/policyGenerator/v1/policygenerator/policyGenerator.go:110 +0x1a11
main.main()
	/go/src/cnf-features-deploy/app/ztp/ztp-policy-generator/kustomize/plugin/policyGenerator/v1/policygenerator/policyGenerator.go:28 +0x154
Traceback (most recent call last):
  File "/usr/src/hook/ztp/resource-generator/src/watcher.py", line 83, in __init__
    raise Exception(f"Manifest conversion failed: {output[1].decode()}")
Exception: Manifest conversion failed: 2022/01/21 18:03:52 Could not build the entire policy defined by tmpey1hlgod: open /tmp/ztp/source-crs/DefaultCatsrc.yaml: no such file or directory
panic: open /tmp/ztp/source-crs/DefaultCatsrc.yaml: no such file or directory

goroutine 1 [running]:
main.InitiatePolicyGen(0x7ffc5eb0e6fc, 0x17, 0x7ffc5eb0e714, 0x13, 0x7ffc5eb0e728, 0x17, 0xc000100000)
	/go/src/cnf-features-deploy/app/ztp/ztp-policy-generator/kustomize/plugin/policyGenerator/v1/policygenerator/policyGenerator.go:110 +0x1a11
main.main()
	/go/src/cnf-features-deploy/app/ztp/ztp-policy-generator/kustomize/plugin/policyGenerator/v1/policygenerator/policyGenerator.go:28 +0x154

Comment 6 yliu1 2022-02-01 18:07:39 UTC
Verified with latest 4.9 ztp site generate image using single catalog source.

Comment 9 errata-xmlrpc 2022-02-23 20:02:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.22 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0561


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