Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoscaling #605

Closed
luisdavim opened this issue Jul 31, 2019 · 11 comments
Closed

Autoscaling #605

luisdavim opened this issue Jul 31, 2019 · 11 comments
Labels
priority/low Not that important. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management.

Comments

@luisdavim
Copy link

Hi, is it possible to integrate the cluster autoscaler with the machine-controller? Or does the controller provide the autoscaling features?

@alvaroaleman
Copy link
Contributor

Hey, thanks for inquiring. What we need is a cluster-autoscaler implementation that supports clusterapi v1alpha1 as backend. @frobware has built one already, althought it isn't merged: kubernetes/autoscaler#1866

Other than that, we'd need to fix #564 (althought that doesn't matter if you run on a platform that does have a cloudprovider)

@luisdavim
Copy link
Author

thanks @alvaroaleman

@kubermatic-bot kubermatic-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 2, 2019
@kubermatic kubermatic deleted a comment from kubermatic-bot Aug 2, 2019
@alvaroaleman alvaroaleman removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 2, 2019
@kubermatic-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kubermatic-bot kubermatic-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 31, 2019
@luisdavim
Copy link
Author

/remove-lifecycle 

@alvaroaleman
Copy link
Contributor

/remove-lifecycle stale

@kubermatic-bot kubermatic-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 31, 2019
@kdomanski kdomanski added priority/low Not that important. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. labels Nov 28, 2019
@kubermatic-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kubermatic-bot kubermatic-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 27, 2020
@kron4eg
Copy link
Member

kron4eg commented Mar 19, 2020

/remove-lifecycle stale

@kubermatic-bot kubermatic-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 19, 2020
@kron4eg
Copy link
Member

kron4eg commented Mar 19, 2020

So, upstream clusterAPI change got merged and released. And machine-controller doesn't need to do anything!

In order to make autoscaling work, MachineDeployments or MachineSets should be annotated like this:

apiVersion: cluster.k8s.io/v1alpha1
kind: MachineDeployment
metadata:
  annotations:
    cluster.k8s.io/cluster-api-autoscaler-node-group-min-size: "1"
    cluster.k8s.io/cluster-api-autoscaler-node-group-max-size: "10"

But such annotations are out of machine-controller scope and should be provided by the user.
See more info at kubernetes/autoscaler#1866

@madalinignisca
Copy link

May I ask how the autoscaler annotation could be used in the output.tf kubeone_workers?

From the examples there is a "$var.cluster_name}-pool1" example.

@kron4eg
Copy link
Member

kron4eg commented Feb 1, 2022

Terraform output is unmarshalled onto

https://github.com/kubermatic/kubeone/blob/8418d9d6c14e38a525618829fc1c36d56a8c3f0a/pkg/apis/kubeone/v1beta2/types.go#L418-L425

so there is annotations field that will be copied to MachineDeployment.ObjectMeta.Annotations

https://github.com/kubermatic/kubeone/blob/8418d9d6c14e38a525618829fc1c36d56a8c3f0a/pkg/apis/kubeone/v1beta2/types.go#L432

so the resulted terraform output would look something like this:

output "kubeone_workers" {
  value = {
    "${var.cluster_name}-pool1" = {
      replicas = var.workers_replicas
      providerSpec = {
        annotations = {
          "cluster.k8s.io/cluster-api-autoscaler-node-group-min-size" = "1"
          "cluster.k8s.io/cluster-api-autoscaler-node-group-max-size" = "10"          
        }
...

@madalinignisca
Copy link

@kron4eg Thank you so much mate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/low Not that important. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management.
Projects
None yet
Development

No branches or pull requests

6 participants