Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

NodePool

Provides a Rancher v2 Node Pool resource. This can be used to create Node Pool, using Node template for Rancher v2 RKE clusters and retrieve their information.

Example Usage

Coming soon!

Coming soon!

Coming soon!

import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";

// Create a new rancher2 RKE Cluster 
const foo_custom = new rancher2.Cluster("foo-custom", {
    description: "Foo rancher2 custom cluster",
    kind: "rke",
    rkeConfig: {
        network: {
            plugin: "canal",
        },
    },
});
// Create a new rancher2 Cloud Credential
const fooCloudCredential = new rancher2.CloudCredential("fooCloudCredential", {
    description: "Terraform cloudCredential acceptance test",
    amazonec2CredentialConfig: {
        accessKey: "XXXXXXXXXXXXXXXXXXXX",
        secretKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    },
});
// Create a new rancher2 Node Template
const fooNodeTemplate = new rancher2.NodeTemplate("fooNodeTemplate", {
    description: "foo test",
    cloudCredentialId: fooCloudCredential.id,
    amazonec2Config: {
        ami: "<AMI_ID>",
        region: "<REGION>",
        securityGroups: ["<AWS_SECURITY_GROUP>"],
        subnetId: "<SUBNET_ID>",
        vpcId: "<VPC_ID>",
        zone: "<ZONE>",
    },
});
// Create a new rancher2 Node Pool
const fooNodePool = new rancher2.NodePool("fooNodePool", {
    clusterId: foo_custom.id,
    hostnamePrefix: "foo-cluster-0",
    nodeTemplateId: fooNodeTemplate.id,
    quantity: 1,
    controlPlane: true,
    etcd: true,
    worker: true,
});

Create a NodePool Resource

new NodePool(name: string, args: NodePoolArgs, opts?: CustomResourceOptions);
def NodePool(resource_name: str, opts: Optional[ResourceOptions] = None, annotations: Optional[Mapping[str, Any]] = None, cluster_id: Optional[str] = None, control_plane: Optional[bool] = None, delete_not_ready_after_secs: Optional[int] = None, etcd: Optional[bool] = None, hostname_prefix: Optional[str] = None, labels: Optional[Mapping[str, Any]] = None, name: Optional[str] = None, node_taints: Optional[Sequence[NodePoolNodeTaintArgs]] = None, node_template_id: Optional[str] = None, quantity: Optional[int] = None, worker: Optional[bool] = None)
func NewNodePool(ctx *Context, name string, args NodePoolArgs, opts ...ResourceOption) (*NodePool, error)
public NodePool(string name, NodePoolArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args NodePoolArgs
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 NodePoolArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NodePoolArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

NodePool Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The NodePool resource accepts the following input properties:

ClusterId string

The RKE cluster id to use Node Pool (string)

HostnamePrefix string

The prefix for created nodes of the Node Pool (string)

NodeTemplateId string

The Node Template ID to use for node creation (string)

Annotations Dictionary<string, object>

Annotations for Node Pool object (map)

ControlPlane bool

RKE control plane role for created nodes (bool)

DeleteNotReadyAfterSecs int

Delete not ready node after secs. For Rancher v2.3.3 or above. Default 0 (int)

Etcd bool

RKE etcd role for created nodes (bool)

Labels Dictionary<string, object>

Labels for Node Pool object (map)

Name string

The name of the Node Pool (string)

NodeTaints List<NodePoolNodeTaintArgs>

Node taints. For Rancher v2.3.3 or above (List)

Quantity int

The number of nodes to create on Node Pool. Default 1. Only values >= 1 allowed (int)

Worker bool

RKE role role for created nodes (bool)

ClusterId string

The RKE cluster id to use Node Pool (string)

HostnamePrefix string

The prefix for created nodes of the Node Pool (string)

NodeTemplateId string

The Node Template ID to use for node creation (string)

Annotations map[string]interface{}

Annotations for Node Pool object (map)

ControlPlane bool

RKE control plane role for created nodes (bool)

DeleteNotReadyAfterSecs int

Delete not ready node after secs. For Rancher v2.3.3 or above. Default 0 (int)

Etcd bool

RKE etcd role for created nodes (bool)

Labels map[string]interface{}

Labels for Node Pool object (map)

Name string

The name of the Node Pool (string)

NodeTaints []NodePoolNodeTaint

Node taints. For Rancher v2.3.3 or above (List)

Quantity int

The number of nodes to create on Node Pool. Default 1. Only values >= 1 allowed (int)

Worker bool

RKE role role for created nodes (bool)

clusterId string

The RKE cluster id to use Node Pool (string)

hostnamePrefix string

The prefix for created nodes of the Node Pool (string)

nodeTemplateId string

The Node Template ID to use for node creation (string)

annotations {[key: string]: any}

Annotations for Node Pool object (map)

controlPlane boolean

RKE control plane role for created nodes (bool)

deleteNotReadyAfterSecs number

Delete not ready node after secs. For Rancher v2.3.3 or above. Default 0 (int)

etcd boolean

RKE etcd role for created nodes (bool)

labels {[key: string]: any}

Labels for Node Pool object (map)

name string

The name of the Node Pool (string)

nodeTaints NodePoolNodeTaint[]

Node taints. For Rancher v2.3.3 or above (List)

quantity number

The number of nodes to create on Node Pool. Default 1. Only values >= 1 allowed (int)

worker boolean

RKE role role for created nodes (bool)

cluster_id str

The RKE cluster id to use Node Pool (string)

hostname_prefix str

The prefix for created nodes of the Node Pool (string)

node_template_id str

The Node Template ID to use for node creation (string)

annotations Mapping[str, Any]

Annotations for Node Pool object (map)

control_plane bool

RKE control plane role for created nodes (bool)

delete_not_ready_after_secs int

Delete not ready node after secs. For Rancher v2.3.3 or above. Default 0 (int)

etcd bool

RKE etcd role for created nodes (bool)

labels Mapping[str, Any]

Labels for Node Pool object (map)

name str

The name of the Node Pool (string)

node_taints Sequence[NodePoolNodeTaintArgs]

Node taints. For Rancher v2.3.3 or above (List)

quantity int

The number of nodes to create on Node Pool. Default 1. Only values >= 1 allowed (int)

worker bool

RKE role role for created nodes (bool)

Outputs

All input properties are implicitly available as output properties. Additionally, the NodePool resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing NodePool Resource

Get an existing NodePool 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?: NodePoolState, opts?: CustomResourceOptions): NodePool
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, annotations: Optional[Mapping[str, Any]] = None, cluster_id: Optional[str] = None, control_plane: Optional[bool] = None, delete_not_ready_after_secs: Optional[int] = None, etcd: Optional[bool] = None, hostname_prefix: Optional[str] = None, labels: Optional[Mapping[str, Any]] = None, name: Optional[str] = None, node_taints: Optional[Sequence[NodePoolNodeTaintArgs]] = None, node_template_id: Optional[str] = None, quantity: Optional[int] = None, worker: Optional[bool] = None) -> NodePool
func GetNodePool(ctx *Context, name string, id IDInput, state *NodePoolState, opts ...ResourceOption) (*NodePool, error)
public static NodePool Get(string name, Input<string> id, NodePoolState? 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:

Annotations Dictionary<string, object>

Annotations for Node Pool object (map)

ClusterId string

The RKE cluster id to use Node Pool (string)

ControlPlane bool

RKE control plane role for created nodes (bool)

DeleteNotReadyAfterSecs int

Delete not ready node after secs. For Rancher v2.3.3 or above. Default 0 (int)

Etcd bool

RKE etcd role for created nodes (bool)

HostnamePrefix string

The prefix for created nodes of the Node Pool (string)

Labels Dictionary<string, object>

Labels for Node Pool object (map)

Name string

The name of the Node Pool (string)

NodeTaints List<NodePoolNodeTaintArgs>

Node taints. For Rancher v2.3.3 or above (List)

NodeTemplateId string

The Node Template ID to use for node creation (string)

Quantity int

The number of nodes to create on Node Pool. Default 1. Only values >= 1 allowed (int)

Worker bool

RKE role role for created nodes (bool)

Annotations map[string]interface{}

Annotations for Node Pool object (map)

ClusterId string

The RKE cluster id to use Node Pool (string)

ControlPlane bool

RKE control plane role for created nodes (bool)

DeleteNotReadyAfterSecs int

Delete not ready node after secs. For Rancher v2.3.3 or above. Default 0 (int)

Etcd bool

RKE etcd role for created nodes (bool)

HostnamePrefix string

The prefix for created nodes of the Node Pool (string)

Labels map[string]interface{}

Labels for Node Pool object (map)

Name string

The name of the Node Pool (string)

NodeTaints []NodePoolNodeTaint

Node taints. For Rancher v2.3.3 or above (List)

NodeTemplateId string

The Node Template ID to use for node creation (string)

Quantity int

The number of nodes to create on Node Pool. Default 1. Only values >= 1 allowed (int)

Worker bool

RKE role role for created nodes (bool)

annotations {[key: string]: any}

Annotations for Node Pool object (map)

clusterId string

The RKE cluster id to use Node Pool (string)

controlPlane boolean

RKE control plane role for created nodes (bool)

deleteNotReadyAfterSecs number

Delete not ready node after secs. For Rancher v2.3.3 or above. Default 0 (int)

etcd boolean

RKE etcd role for created nodes (bool)

hostnamePrefix string

The prefix for created nodes of the Node Pool (string)

labels {[key: string]: any}

Labels for Node Pool object (map)

name string

The name of the Node Pool (string)

nodeTaints NodePoolNodeTaint[]

Node taints. For Rancher v2.3.3 or above (List)

nodeTemplateId string

The Node Template ID to use for node creation (string)

quantity number

The number of nodes to create on Node Pool. Default 1. Only values >= 1 allowed (int)

worker boolean

RKE role role for created nodes (bool)

annotations Mapping[str, Any]

Annotations for Node Pool object (map)

cluster_id str

The RKE cluster id to use Node Pool (string)

control_plane bool

RKE control plane role for created nodes (bool)

delete_not_ready_after_secs int

Delete not ready node after secs. For Rancher v2.3.3 or above. Default 0 (int)

etcd bool

RKE etcd role for created nodes (bool)

hostname_prefix str

The prefix for created nodes of the Node Pool (string)

labels Mapping[str, Any]

Labels for Node Pool object (map)

name str

The name of the Node Pool (string)

node_taints Sequence[NodePoolNodeTaintArgs]

Node taints. For Rancher v2.3.3 or above (List)

node_template_id str

The Node Template ID to use for node creation (string)

quantity int

The number of nodes to create on Node Pool. Default 1. Only values >= 1 allowed (int)

worker bool

RKE role role for created nodes (bool)

Supporting Types

NodePoolNodeTaint

Key string

Taint key (string)

Value string

Taint value (string)

Effect string

Taint effect. Supported values : "NoExecute" | "NoSchedule" | "PreferNoSchedule" (string)

TimeAdded string

Taint time added (string)

Key string

Taint key (string)

Value string

Taint value (string)

Effect string

Taint effect. Supported values : "NoExecute" | "NoSchedule" | "PreferNoSchedule" (string)

TimeAdded string

Taint time added (string)

key string

Taint key (string)

value string

Taint value (string)

effect string

Taint effect. Supported values : "NoExecute" | "NoSchedule" | "PreferNoSchedule" (string)

timeAdded string

Taint time added (string)

key str

Taint key (string)

value str

Taint value (string)

effect str

Taint effect. Supported values : "NoExecute" | "NoSchedule" | "PreferNoSchedule" (string)

time_added str

Taint time added (string)

Import

Node Pool can be imported using the Rancher Node Pool ID

 $ pulumi import rancher2:index/nodePool:NodePool foo &lt;node_pool_id&gt;

Package Details

Repository
https://github.com/pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.