Commit Graph

12 Commits

Author SHA1 Message Date
Jason DeTiberus 1e0fe7c85d
Update group identifier to use for Cluster API annotations
- Also add backwards compatibility for the previously used deprecated annotations
2020-09-28 13:31:37 -04:00
Jason DeTiberus 5753f3f2ab
Add node autodiscovery to cluster-autoscaler clusterapi provider 2020-09-28 13:31:36 -04:00
Jason DeTiberus 9dc30d538c
Convert clusterapi provider to use unstructured
Remove internal types for Cluster API and replace with unstructured access
2020-09-28 13:31:35 -04:00
Kubernetes Prow Robot 6c243fe2ea
Merge pull request #2950 from enxebre/skip-machinedeployment
Let the controller move on if machineDeployments are not available
2020-09-28 11:28:45 -04:00
Michael McCune 143877b835
Add mutex to DeleteNodes in cluster-autoscaler CAPI provider
This change adds a mutex to the MachineController structure which is
used to gate access to the DeleteNodes function.

This is one in a series of PRs to mitigate kubernetes#3104
2020-07-23 15:15:22 -04:00
Joel Speed b898c1f151
Provide fake proivder IDs for failed machines 2020-06-02 12:48:14 -04:00
Enxebre fd59e23744
CAPI: Stop panicking in newMachineController 2020-06-01 15:43:38 -04:00
Michael McCune 4e108b71d4
Add the ability to override CAPI group via env variable and discover API version.
This change adds detection for an environment variable to specify the group for the clusterapi resources. If the environment
variable `CAPI_GROUP` is specified, then it will
be used instead of the default.
This also decouples the API group from the version and let the latter to be discovered dynamically.
2020-04-30 19:03:08 +02:00
Andrew McDermott d9e3197daa Normalize providerID values
We index on providerID but it turns out that those values on node and
machine are not always consistent. Some encode region, some do not,
for example.

This commit normalizes all values through the normalizedProviderString().

To ensure that we catch all places I've introduced a new type and made
the find() functions take this new type in lieu of a string. Unit
tests have also been adjusted to introduce a 'test:///' prefix on the
providerID value to further validate the change.

This change allows CAPI to work out-of-the-box, assuming v1alpha2.

It's also reasonable to assert that this consistency should be
enforced elsewhere and to make this behaviour easily revertable I'm
leaving this as a separate commit in this patch series.
2020-03-10 10:59:05 +00:00
Enxebre 7ba979866a Make machine API swappable as an env variable 2020-03-10 10:59:05 +00:00
Enxebre 699c0b83b4 Let Nodes() return the list of all machines
The autoscaler expects provider implementations nodeGroups to implement the Nodes() function to return the number of instances belonging to the group regardless of they have become a kubernetes node or not.
This information is then used for instance to realise about unregistered nodes bf3a9fb52e/cluster-autoscaler/clusterstate/clusterstate.go (L307-L311)
2020-03-10 10:59:05 +00:00
Andrew McDermott 46bb9b4f29 cloudprovider/clusterapi: new provider
This adds a new cloudprovider based on the cluster-api project:

  https://github.com/kubernetes-sigs/cluster-api
2020-03-10 10:59:04 +00:00