From 4eb83911df6a673e18417238b8a317298bdad2c6 Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Tue, 13 Feb 2018 16:00:17 +0100 Subject: [PATCH 1/2] Fix nvidia gpu resource name on AWS --- cluster-autoscaler/cloudprovider/aws/aws_manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/aws/aws_manager.go b/cluster-autoscaler/cloudprovider/aws/aws_manager.go index 2446e644cbbc..9c69b3503b30 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_manager.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_manager.go @@ -35,6 +35,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" "k8s.io/autoscaler/cluster-autoscaler/config/dynamic" + "k8s.io/autoscaler/cluster-autoscaler/utils/gpu" provider_aws "k8s.io/kubernetes/pkg/cloudprovider/providers/aws" kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis" ) @@ -404,7 +405,7 @@ func (m *AwsManager) buildNodeFromTemplate(asg *Asg, template *asgTemplate) (*ap // TODO: get a real value. node.Status.Capacity[apiv1.ResourcePods] = *resource.NewQuantity(110, resource.DecimalSI) node.Status.Capacity[apiv1.ResourceCPU] = *resource.NewQuantity(template.InstanceType.VCPU, resource.DecimalSI) - node.Status.Capacity[apiv1.ResourceNvidiaGPU] = *resource.NewQuantity(template.InstanceType.GPU, resource.DecimalSI) + node.Status.Capacity[gpu.ResourceNvidiaGPU] = *resource.NewQuantity(template.InstanceType.GPU, resource.DecimalSI) node.Status.Capacity[apiv1.ResourceMemory] = *resource.NewQuantity(template.InstanceType.MemoryMb*1024*1024, resource.DecimalSI) // TODO: use proper allocatable!! From cf27c68d734ee3b7483cb70f0ff023b1fbc1bea2 Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Tue, 13 Feb 2018 16:13:40 +0100 Subject: [PATCH 2/2] Allow scaling to zero on AWS --- cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go index 20918a5b6c8e..4a882dd0128e 100644 --- a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go +++ b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go @@ -28,7 +28,7 @@ import ( "github.com/golang/glog" ) -const scaleToZeroSupported = false +const scaleToZeroSupported = true type asgCache struct { registeredAsgs []*asgInformation