Skip to content

docs: create a flow diagram of the Ignition services#2195

Open
cadejacobson wants to merge 10 commits intocoreos:mainfrom
cadejacobson:mermaid-flow
Open

docs: create a flow diagram of the Ignition services#2195
cadejacobson wants to merge 10 commits intocoreos:mainfrom
cadejacobson:mermaid-flow

Conversation

@cadejacobson
Copy link

While looking through the Ignition booting documentation, I was attempting to piece together how each service interacts with each other and ended up creating a flowchart of the ordering of some of the services. I figured this visual diagram could be useful to other new contributors to the project, and am happy to expand on, or correct, any relationship here as needed.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is a great initiative to visualize the Ignition boot flow, which will be very helpful for new contributors. The diagram is well-structured. I've left a few comments with suggestions to improve the accuracy of the flow in the 'Network Stack' and 'Ignition Fetch' sections, and a minor styling suggestion for consistency. Overall, this is a valuable addition to the documentation.

Comment on lines 39 to 41
D1a --> D2
D1b --> D2
D2 --> D3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This part of the flow could be misleading. Requesting cloud-specific configs (D2) and opening a config device like /dev/sr0 (D3) are typically alternative actions that depend on the detected platform, rather than sequential steps. The current diagram with D2 --> D3 suggests one follows the other. It would be more accurate to represent them as alternative paths.

N4["systemd-networkd.service - Network Configuration"]
N5["network.target reached"]
N6["Get DHCP address"]
N1 --> N2 --> N3 --> N4 --> N5 --> N6

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The order of operations in the network stack appears to be incorrect. The network.target (N5) is reached only after the network is fully configured, which includes acquiring an IP address via DHCP (N6). Therefore, N6 should come before N5 in the sequence.

Suggested change
N1 --> N2 --> N3 --> N4 --> N5 --> N6
N1 --> N2 --> N3 --> N4 --> N6 --> N5

classDef service fill:#42a5f5,stroke:#1565c0,stroke-width:2px,color:#000
classDef target fill:#ffa726,stroke:#e65100,stroke-width:2px,color:#000

class A,B,C,D,E,F,H,I,J,K,N4 service

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The node N1 represents systemd-networkd.service but it's not styled as a service. For consistency, it should be included in the service class definition.

Suggested change
class A,B,C,D,E,F,H,I,J,K,N4 service
class A,B,C,D,E,F,H,I,J,K,N1,N4 service

N3["Link up"]
N4["systemd-networkd.service - Network Configuration"]
N5["network.target reached"]
N6["Get DHCP address"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ignition-fetch.service is after network.target, how do we know if the DHCP succeeded?

Copy link
Author

@cadejacobson cadejacobson Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running through the services and targets (at least on Flatcar), the actual queries to the cloud platforms may be started before the DHCP request has been completed. For example, here are some of the journalctl logs from a recent machine:
image
We see:

  1. The link come up
  2. The system reach network.target
  3. Ignition-fetch.service begin (which is also corroborated in the systemd service file found below:)
  4. Calls to the IMDS user-data begin and fail (presumably because DHCP has not been completed)
  5. The DCHPv4 address 10.0.0.4 return
  6. IMDS user-data is successfully queried (attempt 7)

To answer your question, ignition-fetch.service does not necessarily know that DHCP has succeeded, but it relies on DHCP to do so before the calls to IMDS exhaust the retries.

get_dhcp_address --> online_request_cloud_configs

%% --- Disk & Mount Services ---
FETCH_ONLINE --> kargs_service["ignition-kargs.service"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could mention that a reboot might occur here (and we restart the flow from the beginning) - if a kernel argument is added / removed from the kernel command line.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the flowchart to include the reboot section!

afterburn_hostname_service -.-> files_service
files_service --> quench_service["ignition-quench.service"]
quench_service --> initrd_setup_root["initrd-setup-root-after-ignition.service"]
quench_service --> complete_target["ignition-complete.target"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignition has a ignition-delete-config.service that takes care of deleting the user-data configuration from the cloud provider (only supported for VMWare at this moment, but I'd started a discussion a while ago for Azure to investigate on a similar feature and/or protect user-data access)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great to know about! I had not encountered this as I am primarily running on Azure.

From what I am reading, ignition-delete-config.service seems to be a bit disconnected from the flow of the rest of Ignition. It seems to operate before sysinit.target, but I do not find any other references to sysinit.target in the codebase. Since these two are disjointed, do you have any recommendation on how to include it in the flowchart? I could put it in its own subgraph, but am not sure where to link it. Thanks!

@cadejacobson
Copy link
Author

Ah, I am noticing that GitHub's rendering is rather different than the default VSCode preview:
VSCode:
image
GitHub:
image

Allow me some time to fix this. 😁

subgraph NETWORK ["Network Stack"]
direction TB
networkd_service["systemd-networkd.service"]
find_primary_nic["Find primary NIC"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

networkd doesn't have a concept of "primary NIC", it's DHCPing on all NICs

@cjp256
Copy link

cjp256 commented Feb 17, 2026

in the diagram there's this concept of merging discussed, but what's unclear on both is what artifacts are for each stage.

When fetch-offline checks /usr/lib/ignition/, what happens if there is some config there? Does ignition.json get written out and ignition-fetch.service gets skipped?

We should clarify the outputs and add the conditional for fetch.service on /run/ignition.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments