KubernetesAutoscaler
This resource will help you to manager cluster-autoscaler in Kubernetes Cluster.
NOTE: The scaling group must use CentOS7 or AliyunLinux2 as base image.
NOTE: The cluster-autoscaler can only use the same size of instanceTypes in one scaling group.
NOTE: Add Policy to RAM role of the node to deploy cluster-autoscaler if you need.
NOTE: Available in 1.65.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var @default = new AliCloud.CS.KubernetesAutoscaler("default", new AliCloud.CS.KubernetesAutoscalerArgs
{
ClusterId = @var.Cluster_id,
CoolDownDuration = @var.Cool_down_duration,
DeferScaleInDuration = @var.Defer_scale_in_duration,
Nodepools =
{
new AliCloud.CS.Inputs.KubernetesAutoscalerNodepoolArgs
{
Id = "scaling_group_id",
Labels = "a=b",
Taints = "c=d:NoSchedule",
},
},
Utilization = @var.Utilization,
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.cs.KubernetesAutoscaler("default",
cluster_id=var["cluster_id"],
cool_down_duration=var["cool_down_duration"],
defer_scale_in_duration=var["defer_scale_in_duration"],
nodepools=[{
"id": "scaling_group_id",
"labels": "a=b",
"taints": "c=d:NoSchedule",
}],
utilization=var["utilization"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const defaultKubernetesAutoscaler = new alicloud.cs.KubernetesAutoscaler("default", {
clusterId: var_cluster_id,
coolDownDuration: var_cool_down_duration,
deferScaleInDuration: var_defer_scale_in_duration,
nodepools: [{
id: "scaling_group_id",
labels: "a=b",
taints: "c=d:NoSchedule",
}],
utilization: var_utilization,
});Create a KubernetesAutoscaler Resource
new KubernetesAutoscaler(name: string, args: KubernetesAutoscalerArgs, opts?: CustomResourceOptions);def KubernetesAutoscaler(resource_name, opts=None, cluster_id=None, cool_down_duration=None, defer_scale_in_duration=None, nodepools=None, use_ecs_ram_role_token=None, utilization=None, __props__=None);func NewKubernetesAutoscaler(ctx *Context, name string, args KubernetesAutoscalerArgs, opts ...ResourceOption) (*KubernetesAutoscaler, error)public KubernetesAutoscaler(string name, KubernetesAutoscalerArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args KubernetesAutoscalerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KubernetesAutoscalerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KubernetesAutoscalerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
KubernetesAutoscaler Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The KubernetesAutoscaler resource accepts the following input properties:
- Cluster
Id string The id of kubernetes cluster.
- Cool
Down stringDuration The cool_down_duration option of cluster-autoscaler.
- Defer
Scale stringIn Duration The defer_scale_in_duration option of cluster-autoscaler.
- Utilization string
The utilization option of cluster-autoscaler.
- Nodepools
List<Pulumi.
Ali Cloud. CS. Inputs. Kubernetes Autoscaler Nodepool Args> nodepools.id- (Required) The scaling group id of the groups configured for cluster-autoscaler.nodepools.taints- (Required) The taints for the nodes in scaling group.nodepools.labels- (Required) The labels for the nodes in scaling group.
- Use
Ecs boolRam Role Token Enable autoscaler access to alibabacloud service by ecs ramrole token. default: false
- Cluster
Id string The id of kubernetes cluster.
- Cool
Down stringDuration The cool_down_duration option of cluster-autoscaler.
- Defer
Scale stringIn Duration The defer_scale_in_duration option of cluster-autoscaler.
- Utilization string
The utilization option of cluster-autoscaler.
- Nodepools
[]Kubernetes
Autoscaler Nodepool nodepools.id- (Required) The scaling group id of the groups configured for cluster-autoscaler.nodepools.taints- (Required) The taints for the nodes in scaling group.nodepools.labels- (Required) The labels for the nodes in scaling group.
- Use
Ecs boolRam Role Token Enable autoscaler access to alibabacloud service by ecs ramrole token. default: false
- cluster
Id string The id of kubernetes cluster.
- cool
Down stringDuration The cool_down_duration option of cluster-autoscaler.
- defer
Scale stringIn Duration The defer_scale_in_duration option of cluster-autoscaler.
- utilization string
The utilization option of cluster-autoscaler.
- nodepools
Kubernetes
Autoscaler Nodepool[] nodepools.id- (Required) The scaling group id of the groups configured for cluster-autoscaler.nodepools.taints- (Required) The taints for the nodes in scaling group.nodepools.labels- (Required) The labels for the nodes in scaling group.
- use
Ecs booleanRam Role Token Enable autoscaler access to alibabacloud service by ecs ramrole token. default: false
- cluster_
id str The id of kubernetes cluster.
- cool_
down_ strduration The cool_down_duration option of cluster-autoscaler.
- defer_
scale_ strin_ duration The defer_scale_in_duration option of cluster-autoscaler.
- utilization str
The utilization option of cluster-autoscaler.
- nodepools
List[Kubernetes
Autoscaler Nodepool] nodepools.id- (Required) The scaling group id of the groups configured for cluster-autoscaler.nodepools.taints- (Required) The taints for the nodes in scaling group.nodepools.labels- (Required) The labels for the nodes in scaling group.
- use_
ecs_ boolram_ role_ token Enable autoscaler access to alibabacloud service by ecs ramrole token. default: false
Outputs
All input properties are implicitly available as output properties. Additionally, the KubernetesAutoscaler resource produces the following output properties:
Look up an Existing KubernetesAutoscaler Resource
Get an existing KubernetesAutoscaler resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: KubernetesAutoscalerState, opts?: CustomResourceOptions): KubernetesAutoscalerstatic get(resource_name, id, opts=None, cluster_id=None, cool_down_duration=None, defer_scale_in_duration=None, nodepools=None, use_ecs_ram_role_token=None, utilization=None, __props__=None);func GetKubernetesAutoscaler(ctx *Context, name string, id IDInput, state *KubernetesAutoscalerState, opts ...ResourceOption) (*KubernetesAutoscaler, error)public static KubernetesAutoscaler Get(string name, Input<string> id, KubernetesAutoscalerState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Cluster
Id string The id of kubernetes cluster.
- Cool
Down stringDuration The cool_down_duration option of cluster-autoscaler.
- Defer
Scale stringIn Duration The defer_scale_in_duration option of cluster-autoscaler.
- Nodepools
List<Pulumi.
Ali Cloud. CS. Inputs. Kubernetes Autoscaler Nodepool Args> nodepools.id- (Required) The scaling group id of the groups configured for cluster-autoscaler.nodepools.taints- (Required) The taints for the nodes in scaling group.nodepools.labels- (Required) The labels for the nodes in scaling group.
- Use
Ecs boolRam Role Token Enable autoscaler access to alibabacloud service by ecs ramrole token. default: false
- Utilization string
The utilization option of cluster-autoscaler.
- Cluster
Id string The id of kubernetes cluster.
- Cool
Down stringDuration The cool_down_duration option of cluster-autoscaler.
- Defer
Scale stringIn Duration The defer_scale_in_duration option of cluster-autoscaler.
- Nodepools
[]Kubernetes
Autoscaler Nodepool nodepools.id- (Required) The scaling group id of the groups configured for cluster-autoscaler.nodepools.taints- (Required) The taints for the nodes in scaling group.nodepools.labels- (Required) The labels for the nodes in scaling group.
- Use
Ecs boolRam Role Token Enable autoscaler access to alibabacloud service by ecs ramrole token. default: false
- Utilization string
The utilization option of cluster-autoscaler.
- cluster
Id string The id of kubernetes cluster.
- cool
Down stringDuration The cool_down_duration option of cluster-autoscaler.
- defer
Scale stringIn Duration The defer_scale_in_duration option of cluster-autoscaler.
- nodepools
Kubernetes
Autoscaler Nodepool[] nodepools.id- (Required) The scaling group id of the groups configured for cluster-autoscaler.nodepools.taints- (Required) The taints for the nodes in scaling group.nodepools.labels- (Required) The labels for the nodes in scaling group.
- use
Ecs booleanRam Role Token Enable autoscaler access to alibabacloud service by ecs ramrole token. default: false
- utilization string
The utilization option of cluster-autoscaler.
- cluster_
id str The id of kubernetes cluster.
- cool_
down_ strduration The cool_down_duration option of cluster-autoscaler.
- defer_
scale_ strin_ duration The defer_scale_in_duration option of cluster-autoscaler.
- nodepools
List[Kubernetes
Autoscaler Nodepool] nodepools.id- (Required) The scaling group id of the groups configured for cluster-autoscaler.nodepools.taints- (Required) The taints for the nodes in scaling group.nodepools.labels- (Required) The labels for the nodes in scaling group.
- use_
ecs_ boolram_ role_ token Enable autoscaler access to alibabacloud service by ecs ramrole token. default: false
- utilization str
The utilization option of cluster-autoscaler.
Supporting Types
KubernetesAutoscalerNodepool
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.