Make ARM Machine goals authoritative and acknowledge RP node updates - #256
Make ARM Machine goals authoritative and acknowledge RP node updates#256Thalia Wang (wenxuan0923) wants to merge 4 commits into
Conversation
| return t.handleError("update machine", err) | ||
| } | ||
| return t.adoptSettingsVersion(machine, "update machine") | ||
| t.logger.Info("ARM machine already registered, adopting remote goal") |
There was a problem hiding this comment.
this might be problematic if i use a config with the same machine name across multiple different hosts? This could result in different hosts trying to join as the same node to the cluster
There was a problem hiding this comment.
Yea this is a real risk but it seems to be pre-existing tho...? The old code also accepted the Machine when versions matched, or overwrote it when they differed...
There was a problem hiding this comment.
that is true... maybe ask in a different way: why we want to override with remote state instead of following the local config? If we want to override it, maybe just ignore the version from config at all? Also I am curious about the impact of preflight and offline bootstrapping as both steps are relying on goal state here
There was a problem hiding this comment.
We override it because the ARM Machine resource should be the source of truth once it exists. The local config is only used for the initial bootstrap and is never updated. If the customer later updates labels or taints through PUT Machine, or upgrades k8s version through PUT AgentPool calls, we want to use those remote values. Otherwise, a restart or repave could use the stale local config and undo the updates.
We still need the version from config to create the Machine initially, or as a fallback if optional registration fails. Once we get a valid Machine, we use its version instead.
There was a problem hiding this comment.
We still need the version from config to create the Machine initially, or as a fallback if optional registration fails. Once we get a valid Machine, we use its version instead
But isn't this the current behavior before the change?
There was a problem hiding this comment.
how about this, we add a check in preflight check to 1) fetch the machine state 2) warn or fail if the k8s version doesn't match between the config and remote config. I don't want us to force upgrade in this code path because the change from this PR ignores the preflight check result, which could make the offline bootstrap fails.
There was a problem hiding this comment.
Added a new preflight check for comparing the remote/local config here: fc907f4
|
Tracking a reconciliation invariant identified while working on #263:
Suggested regression coverage:
If max pods or image GC thresholds become mutable later, they should be added to |
Summary
SettingsVersion.AppliedGoal.Goal-state ownership
Local configuration seeds the initial goal with Kubernetes version, max pods, labels, taints, and kubelet image-GC thresholds. After
GetorCreatereturns a valid Machine, its complete goal replaces the config-derived goal.The final nspawn goal remains hybrid: Kubernetes version, labels, and taints come from the Machine goal, while networking, credentials, runtime versions, images, mounts, and other host settings remain config-derived.
When best-effort Machine registration fails, bootstrap continues with the local goal and an empty
SettingsVersion.