The project is written as a set of communicating containers. It allows to scale different parts of the application according to needs. It also increases application robustness, because even if one component have some issues (errors, down times), the others are not impacted with that work.
The components are manager, listener, evaluator-{upload,recalc}, aggregator, vmaas_sync, database and
database_admin.
-
manager - serves information about evaluated systems for a given account via REST API. It allows to display:
- list of all systems registered for a given account with advisory related stats,
- list of advisories evaluated for any of these systems,
- list of all advisories, related to at least one system, with stats (e.g. related systems count).
Manager component depends on database storage only and it's also the only application component directly accesed by
application frontend. So it ensures high application stability and availability. It supports
RBACand so it depends on this service, however it can be disabled by settingENABLE_RBAC=no. See component environment variables
-
listener - connects to the Kafka service, and listens for messages about newly uploaded archives. When a new archive is uploaded, it upserts
system_inventory(includingvmaas_jsonwith installed packages, repos, and modules) and the matchingsystem_patchrow. Upload locks and checksum logic apply tosystem_inventory. It registers repositories for the system by pairingrepowith the internal system id (system_inventory.id) throughsystem_repo. After that it sends a Kafka message (patchman.evaluator.uploadtopic) to evaluate the system with theevaluator-uploadcomponent. This component also handles system deleting events (platform.inventory.eventsKafka topic). It consumes template events from Content Sources (platform.content-sources.template), upsertstemplatemetadata, and ontemplate-updatedsyncstemplate_advisoryrows from the Content Sources API. When template advisories change andtemplate_advisory_evalis enabled, it sends a bulk re-evaluation message topatchman.evaluator.user-evaluation. See component environment variables -
evaluator-upload - connects to the Kafka service (
patchman.evaluator.uploadtopic) and listens for evaluation requests from thelistenercomponent. For each received Kafka message it evaluates system with ID contained in the message. It loads each system by joiningsystem_inventoryandsystem_patch. As an evaluation result it updatessystem_advisories(referencingsystem_inventory.id),system_patch(evaluation caches,last_evaluation, and related fields), andadvisory_account_data. Evaluation is scaled on two levels, firstly with multiple replicas (more pods) and secondary with multiple goroutines within single pod (set byCONSUMER_COUNTenvironment variable). See component environment variables -
evaluator-recalc - same as the
-uploadinstance but receives Kafka messages fromvmaas-synccomponent (patchman.evaluator.recalcKafka topic) after advisories list is updated in database (advisory_metadatadatabase table). After this event all registered systems have to be re-evaluated because the input data for the system evaluation has changed. See component environment variables -
evaluator-user-evaluation - same as the
-uploadinstance, but listens for re-evaluation requests from themanagercomponent when user adds or removes systems from a template, and from thelistenerwhen template advisory content changes (patchman.evaluator.user-evaluationtopic). Recalc messages carry explicitsystem_ids; the listener resolves template-assigned systems before sending. The requests are separated as when there is a heavy load from inventory at the time it may take very long for systems to be recalculated/updated. See component environment variables -
aggregator - maintains per-account, per-workspace advisory counts. When the evaluator processes a system upload or recalculation and updates
system_advisories, it publishes anAdvisoryUpdateEventto thepatchman.advisory.updateKafka topic listing which advisory IDs changed for a given account. The aggregator consumes these events and recounts how many systems have each advisory applicable or installable, writing the results toaccount_advisory. This is the workspace-aware replacement foradvisory_account_data(previously maintained by the evaluator). Incoming events are batched before processing. Whenenable_notificationsis set inPOD_CONFIG, the aggregator also publishes new installable advisories toplatform.notifications.ingressand marks them as notified inaccount_advisory. See component environment variables -
vmaas-sync - connects to VMaaS, and upon receiving notification about updated data, syncs new advisories into the database, and requests re-evaluation for systems which could be affected by new advisories. It's done via messaging to the
patchman.evaluator.recalcKafka topic and receiving by theevaluator-recalccomponent. Recalculation can be done in two modes. It's either done for all active systems or based on updated repositories. In this case only systems paired with updated repositories are selected and sent to recalculation. This mode is enabled by settingENABLE_REPO_BASED_RE_EVALUATION=true. This component also performs system culling. Using container CLI it's possible to manually trigger advisories update (./scripts/sync.sh) and systems recalculation (./scripts/re-calc.sh). See component environment variables -
database - Stores data about systems, advisories, system advisories and different related data. Detailed description of the component and data layout are in separate page.
-
database-admin - Executes database initialization and migrations. It needs all rights for the database. It also creates database users for all components and updates passwords for them, so it reads passwords for admin and all components from environment variables. In production a db-migration Job runs migrations once per deploy; other pods wait in check-for-db init until the schema is current. Before DDL it sets app users (
listener,evaluator,manager,vmaas_sync) toNOLOGIN, optionally terminates lingering sessions whenterminate_db_sessions=true, waits until no app sessions remain, runs migrations, then restoresLOGIN. See Database migrations and the major migration runbook. Using container CLI it's possible to manually manage database (./scripts/psql.sh). See component environment variables
When Content Sources publishes a template-updated event:
- listener upserts
templatemetadata and calls Content SourcesGET /templates/{uuid}/advisories/ids. - listener diffs the response against
template_advisoryand inserts or deletes rows. - If advisories changed and
template_advisory_eval=true, listener looks up systems assigned to the template and sendsPlatformEvent{system_ids}topatchman.evaluator.user-evaluation. - evaluator-user-evaluation re-evaluates each system in the message.
- For template-assigned systems, evaluator skips yum updates, calls VMaaS, and marks advisories in
template_advisoryas installable; other applicable advisories remain applicable.
One flag controls the full template-advisory feature. Set template_advisory_eval=true in POD_CONFIG on:
- listener — triggers re-evaluation when template advisory content changes or a template is deleted
- evaluator-upload, evaluator-user-evaluation, and evaluator-recalc — applies installability from
template_advisoryfor template-assigned systems
Default is false everywhere. Enable listener and evaluator pods together; listener-only leaves advisories synced but
installability unchanged, evaluator-only leaves content changes without automatic recalc.
This is separate from manager template_change_eval, which still controls recalc when users assign or remove systems
via the REST API.
