Drift: NodeClass changes that do not show on the server never drift nodes #24
Labels
No labels
accessibility
bot
bug
dependencies
docker
documentation
duplicate
enhancement
go
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/karpenter-provider-hetzner#24
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Changing a
HCloudNodeClassdoes not drift the nodes made from it unless the change shows up on the running server.IsDriftedinpkg/cloudprovider/cloudprovider.gocompares the server against the NodeClass for image ID, network, firewalls, server type, location and labels. Nothing else in the spec is compared, so an edit to any of these leaves existing nodes in place indefinitely:bootstrap(beforeJoin,afterJoin,k0sVersion)imageSelector: the recorded image ID is compared with the server's own image, which never changes, so a new selector is never detectedsshKeyIDsenablePublicIPv4,enablePublicIPv6Seen with 0.7.2: a sysctl added to
beforeJoinreached new nodes only; existing NodeClaims never got aDriftedcondition, and restarting the controller did not change that. The only way to apply it was to delete the NodeClaims by hand.Most of these fields cannot be read back from the server, so comparing them against the server cannot work. The AWS provider solves the same problem with a hash: the NodeClass carries a hash of its spec (
karpenter.k8s.aws/ec2nodeclass-hash, plus-hash-version), each NodeClaim is stamped with the hash at launch, and a mismatch is reported asNodeClassDrift. Fields that are checked against the server, or that change without needing new nodes, are excluded from the hash. The hash version lets a later change to the hashed fields avoid drifting every node at upgrade.Written by an AI, reviewed by a human being.