bhouse-nexthop opened a new pull request, #120: URL: https://github.com/apache/cloudstack-kubernetes-provider/pull/120
`InstanceShutdown` and `InstanceShutdownByProviderID` returned `NotImplemented`. When a node's VM was stopped in CloudStack, the node lifecycle controller could not tell it from an unreachable node: it never applied `node.cloudprovider.kubernetes.io/shutdown`, and on the InstancesV2 path it logged `error checking if node <name> is shutdown: unimplemented` for every NotReady node on each monitor period. Both now look up the instance and report it shut down when its state is `Stopped`. | Instance state | Before | After | |---|---|---| | `Stopped` | error `unimplemented` | shut down: the node gets the taint | | `Starting`, `Running`, `Stopping`, `Migrating` | error `unimplemented` | not shut down | | not found | error `unimplemented` | `InstanceNotFound` | - `Stopping` is not shut down: the guest may still be running and writing to its volumes. - `InstanceShutdown` finds the instance by node name, as `InstanceExists` does. The controller calls both on the same node, so they look at the same VM, and it works on nodes without a provider ID. - The controller removes the taint itself once the node is Ready again. Testing - `make test`: all tests pass, 0 failures; 18 new subtests: state mapping, node unknown to CloudStack, API errors, instance deleted between lookups, and `InstanceShutdownByProviderID` in the existing lookup table (project scoping, scheme stripping, not found, API error). - `make lint` (golangci-lint 2.15.0): 0 issues. - Not yet tested on a cluster. I'll add a test report: stop a worker VM, check the taint appears, start it, check the taint goes. Not done - The shutdown taint is `NoSchedule` only. It doesn't release a stopped node's volumes; that is Kubernetes' `node.kubernetes.io/out-of-service` taint. - With a root-admin API key, a destroyed but not yet expunged VM is still listed, so the node is reported as existing and not shut down. With an account key (as CKS uses) it isn't listed. - `InstanceExists` still returns an error rather than `false` when the node's VM is gone. That is a separate change. Fixes #119 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
