-
Notifications
You must be signed in to change notification settings - Fork 24
Add IOP #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ehelms
wants to merge
15
commits into
theforeman:master
Choose a base branch
from
ehelms:add-iop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add IOP #280
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a7b01ed
Add iop_kafka
ehelms 01d0466
Add iop_ingress
ehelms a14a3a4
Add iop_puptoo
ehelms 8140f5b
Add iop_yuptoo
ehelms e934a9d
Add iop_engine
ehelms 21effb1
Add iop_gateway
ehelms 200c861
Add iop_inventory
ehelms 405a4dc
Add iop_advisor
ehelms 29a03c1
Add iop_remediation
ehelms 95c2c03
Add iop_vmaas and iop_vulnerability
ehelms 87c210a
Add frontends for advisor and vulnerability
ehelms f9f3302
Add iop test github actions
ehelms 378c768
Specify explicit volume mount permissions
ehelms 77cfed2
Use nightly tag for images
ehelms beb1c06
Add documentation
ehelms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,16 @@ These base features control which plugins are enabled when a feature is requeste | |
|
|
||
| A deployment can have multiple base features enabled. | ||
|
|
||
| ### Enabling IOP | ||
|
|
||
| IOP (Insights Operating Platform) deploys on-premise Insights services for advisor, vulnerability, and remediation. It requires internal database mode and depends on the `rh-cloud` and `katello` features. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😆
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AI garbage aside, I'd prefer this be styled properly as |
||
|
|
||
| ```bash | ||
| ./foremanctl deploy --add-feature iop | ||
| ``` | ||
|
|
||
| See [IOP Architecture](iop.md) for details on the services deployed and configuration options. | ||
|
|
||
| ### Authenticated Registry Handling | ||
|
|
||
| If you need to pull images from private or authenticated container registries, you can configure registry authentication using Podman's auth file. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| # IOP (Insights Operating Platform) | ||
|
|
||
| IOP deploys the on-premise Insights services that provide advisor, vulnerability, and remediation capabilities integrated with Foreman. | ||
|
|
||
| ## Enabling IOP | ||
|
|
||
| Add `iop` to `enabled_features` in your flavor configuration. IOP requires internal database mode (`database_mode: internal`). | ||
|
|
||
| The `iop` feature depends on `rh-cloud`, which installs the `foreman_rh_cloud` plugin into Foreman and `katello` as a transitive dependency. | ||
|
|
||
| ## Architecture | ||
|
|
||
| IOP runs as a set of containerized services managed via podman quadlets on the `iop-core-network` (bridge, `10.130.0.0/24`). The gateway is registered as a Foreman smart proxy at `https://localhost:24443`. | ||
|
|
||
| ```mermaid | ||
| graph TB | ||
| subgraph Host["Host System"] | ||
| Foreman["Foreman<br/>(foreman_rh_cloud)"] | ||
| Apache["Apache httpd"] | ||
| PG[(PostgreSQL)] | ||
|
|
||
| subgraph Network["iop-core-network (10.130.0.0/24)"] | ||
| Kafka[Kafka] | ||
|
|
||
| subgraph Core["Core Pipeline"] | ||
| Ingress[Ingress] | ||
| Puptoo[Puptoo] | ||
| Yuptoo[Yuptoo] | ||
| Engine[Engine] | ||
| end | ||
|
|
||
| Gateway["Gateway<br/>:24443"] | ||
|
|
||
| subgraph Services["Application Services"] | ||
| Inventory["Inventory API<br/>:8081"] | ||
| Advisor["Advisor API<br/>:8000"] | ||
| Remediation["Remediation API<br/>:3000"] | ||
| VMAAS["VMAAS<br/>(reposcan + webapp)"] | ||
| Vuln["Vulnerability<br/>(8 containers)"] | ||
| end | ||
| end | ||
|
|
||
| subgraph Frontends["Frontend Assets (/var/www/iop)"] | ||
| AdvisorFE[Advisor Frontend] | ||
| VulnFE[Vulnerability Frontend] | ||
| end | ||
| end | ||
|
|
||
| Foreman -- "smart proxy<br/>relay" --> Gateway | ||
| Gateway --> Kafka | ||
| Apache -- "Alias" --> Frontends | ||
|
|
||
| Ingress --> Kafka | ||
| Puptoo --> Kafka | ||
| Yuptoo --> Kafka | ||
| Engine --> Kafka | ||
|
|
||
| Inventory --> Kafka | ||
| Inventory --> PG | ||
| Advisor --> Kafka | ||
| Advisor --> Inventory | ||
| Advisor -. "FDW" .-> PG | ||
| Remediation --> Advisor | ||
| Remediation --> Inventory | ||
| VMAAS --> PG | ||
| VMAAS --> Gateway | ||
| Vuln --> Kafka | ||
| Vuln --> Inventory | ||
| Vuln --> VMAAS | ||
| Vuln -. "FDW" .-> PG | ||
| ``` | ||
|
|
||
| ### Services | ||
|
|
||
| | Service | Container(s) | Port | Description | | ||
| |---------|-------------|------|-------------| | ||
| | kafka | `iop-core-kafka` | 9092 (internal) | Message broker (KRaft mode) | | ||
| | ingress | `iop-core-ingress` | 8080 (internal) | Upload ingestion endpoint | | ||
| | puptoo | `iop-core-puptoo` | - | Puppet/system facts processor | | ||
| | yuptoo | `iop-core-yuptoo` | - | Yum/package data processor | | ||
| | engine | `iop-core-engine` | - | Insights rules engine | | ||
| | gateway | `iop-core-gateway` | 127.0.0.1:24443 | nginx proxy, smart proxy relay to Foreman | | ||
| | inventory | `iop-core-host-inventory`, `iop-core-host-inventory-api` | 8081 (internal) | Host inventory with MQ consumer and REST API | | ||
| | advisor | `iop-service-advisor-backend-api`, `iop-service-advisor-backend-service` | 8000 (internal) | Advisor recommendations | | ||
| | remediation | `iop-service-remediations-api` | 3000 (host network) | Remediation playbook generation | | ||
| | vmaas | `iop-service-vmaas-reposcan`, `iop-service-vmaas-webapp-go` | - | Vulnerability metadata and advisory sync | | ||
| | vulnerability | 8 containers (manager, taskomatic, grouper, listener, evaluators, vmaas-sync) | 8443 (internal) | Vulnerability assessment pipeline | | ||
|
|
||
| ### Frontend Assets | ||
|
|
||
| Advisor and vulnerability frontend assets are extracted from container images and served by Apache: | ||
|
|
||
| - Assets are deployed to `/var/www/iop/assets/apps/{advisor,vulnerability}` | ||
| - Apache serves them via `Alias` directives in `/etc/httpd/conf.d/05-foreman-ssl.d/` | ||
| - Assets include gzip precompression support and 1-year cache headers | ||
|
|
||
| ### Databases | ||
|
|
||
| IOP creates five PostgreSQL databases, all accessible to containers via `host.containers.internal:5432`: | ||
|
|
||
| | Database | User | | ||
| |----------|------| | ||
| | `inventory_db` | `inventory_admin` | | ||
| | `advisor_db` | `advisor_user` | | ||
| | `remediations_db` | `remediations_user` | | ||
| | `vmaas_db` | `vmaas_admin` | | ||
| | `vulnerability_db` | `vulnerability_admin` | | ||
|
|
||
| Advisor and vulnerability services use PostgreSQL foreign data wrappers (FDW) to query the inventory database directly. | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Foreman Connection | ||
|
|
||
| Set in the playbook vars or inventory to match your Foreman deployment: | ||
|
|
||
| | Variable | Default | Description | | ||
| |----------|---------|-------------| | ||
| | `iop_core_foreman_url` | `https://{{ ansible_facts['fqdn'] }}` | Foreman server URL | | ||
| | `iop_core_foreman_admin_username` | `admin` | Foreman admin username | | ||
| | `iop_core_foreman_admin_password` | `changeme` | Foreman admin password | | ||
|
|
||
| ### Certificates | ||
|
|
||
| Gateway certificates are configured per certificate source: | ||
|
|
||
| **Default certificates** (`certificate_source: default`): | ||
| - Server: `/root/certificates/certs/localhost.crt` | ||
| - Client: `/root/certificates/certs/localhost-client.crt` | ||
| - CA: `/root/certificates/certs/ca.crt` | ||
|
|
||
| **Installer certificates** (`certificate_source: installer`): | ||
| - Server: `/root/ssl-build/localhost/localhost-iop-core-gateway-server.crt` | ||
| - Client: `/root/ssl-build/localhost/localhost-iop-core-gateway-client.crt` | ||
| - CA: `/root/ssl-build/katello-default-ca.crt` | ||
|
|
||
| ### Container Images | ||
|
|
||
| All IOP images default to `quay.io/iop/<service>:foreman-3.16`. Each role exposes `iop_<role>_container_image` and `iop_<role>_container_tag` variables to override. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| iop_advisor_container_image: "quay.io/iop/advisor-backend" | ||
| iop_advisor_container_tag: "foreman-3.16" | ||
|
|
||
| iop_advisor_database_name: advisor_db | ||
ehelms marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| iop_advisor_database_user: advisor_user | ||
| iop_advisor_database_password: CHANGEME | ||
| iop_advisor_database_host: host.containers.internal | ||
| iop_advisor_database_port: 5432 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| - name: Check if advisor backend api service exists | ||
| ansible.builtin.systemd: | ||
| name: iop-service-advisor-backend-api | ||
| register: iop_advisor_api_service_status | ||
| failed_when: false | ||
| listen: restart advisor | ||
|
|
||
| - name: Restart advisor backend api service if it exists | ||
| ansible.builtin.systemd: | ||
| name: iop-service-advisor-backend-api | ||
| state: restarted | ||
| when: iop_advisor_api_service_status.status is defined and iop_advisor_api_service_status.status.LoadState != "not-found" | ||
| listen: restart advisor | ||
|
|
||
| - name: Check if advisor backend service exists | ||
| ansible.builtin.systemd: | ||
| name: iop-service-advisor-backend-service | ||
| register: iop_advisor_service_status | ||
| failed_when: false | ||
| listen: restart advisor | ||
|
|
||
| - name: Restart advisor backend service if it exists | ||
| ansible.builtin.systemd: | ||
| name: iop-service-advisor-backend-service | ||
| state: restarted | ||
| when: iop_advisor_service_status.status is defined and iop_advisor_service_status.status.LoadState != "not-found" | ||
| listen: restart advisor |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calls to
foremanctl deployare expensive (adds ca 2 minutes to the execution), so I wonder if it'd be smarter to have fewer of those "add optional feature" steps and use something like{{ matrix.iop == 'enabled' && '--add-feature iop' || '' }}inside an existing step