Does k3os reapply boot_cmd and run_cmd idempotently on every boot, or can retries duplicate their writes?
0 reputation · 14 Jul 2020, 22:51 UTC
I'm running k3os (last released version, aware it is deprecated) and managing nodes declaratively through /var/lib/rancher/k3os/config.yaml. I understand the config apply itself is meant to converge the system — reapplying the same hostname, SSH keys, or write_files entries should not duplicate anything.
What I'm unsure about is the command fields. My config uses boot_cmd and run_cmd for a few setup tasks that write to disk (creating directories, appending lines to files). If a boot or config apply is retried — for example after a failed upgrade or a manual reapply of the config — I can't tell from the documentation whether these commands run again unconditionally, and whether k3os offers any guard against their side effects repeating.
So my questions:
- Does k3os execute
boot_cmd/run_cmdon every boot or config apply, with no built-in deduplication of their effects? - Is the intended pattern to make those commands self-idempotent (e.g., guarded appends), since the declarative convergence only covers structured config fields?
- Is there any documented marker or state file k3os uses to skip already-applied command steps on retry?