nomad.NodePool
Explore with Pulumi AI
Provisions a node pool within a Nomad cluster.
Example Usage
Registering a node pool:
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";
const dev = new nomad.NodePool("dev", {
name: "dev",
description: "Nodes for the development environment.",
meta: {
department: "Engineering",
env: "dev",
},
});
import pulumi
import pulumi_nomad as nomad
dev = nomad.NodePool("dev",
name="dev",
description="Nodes for the development environment.",
meta={
"department": "Engineering",
"env": "dev",
})
package main
import (
"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := nomad.NewNodePool(ctx, "dev", &nomad.NodePoolArgs{
Name: pulumi.String("dev"),
Description: pulumi.String("Nodes for the development environment."),
Meta: pulumi.StringMap{
"department": pulumi.String("Engineering"),
"env": pulumi.String("dev"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nomad = Pulumi.Nomad;
return await Deployment.RunAsync(() =>
{
var dev = new Nomad.NodePool("dev", new()
{
Name = "dev",
Description = "Nodes for the development environment.",
Meta =
{
{ "department", "Engineering" },
{ "env", "dev" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nomad.NodePool;
import com.pulumi.nomad.NodePoolArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var dev = new NodePool("dev", NodePoolArgs.builder()
.name("dev")
.description("Nodes for the development environment.")
.meta(Map.ofEntries(
Map.entry("department", "Engineering"),
Map.entry("env", "dev")
))
.build());
}
}
resources:
dev:
type: nomad:NodePool
properties:
name: dev
description: Nodes for the development environment.
meta:
department: Engineering
env: dev
Create NodePool Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NodePool(name: string, args?: NodePoolArgs, opts?: CustomResourceOptions);
@overload
def NodePool(resource_name: str,
args: Optional[NodePoolArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def NodePool(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
meta: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
scheduler_config: Optional[NodePoolSchedulerConfigArgs] = None)
func NewNodePool(ctx *Context, name string, args *NodePoolArgs, opts ...ResourceOption) (*NodePool, error)
public NodePool(string name, NodePoolArgs? args = null, CustomResourceOptions? opts = null)
public NodePool(String name, NodePoolArgs args)
public NodePool(String name, NodePoolArgs args, CustomResourceOptions options)
type: nomad:NodePool
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
- args NodePoolArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control 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.
- name String
- The unique name of the resource.
- args NodePoolArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var nodePoolResource = new Nomad.NodePool("nodePoolResource", new()
{
Description = "string",
Meta =
{
{ "string", "string" },
},
Name = "string",
SchedulerConfig = new Nomad.Inputs.NodePoolSchedulerConfigArgs
{
MemoryOversubscription = "string",
SchedulerAlgorithm = "string",
},
});
example, err := nomad.NewNodePool(ctx, "nodePoolResource", &nomad.NodePoolArgs{
Description: pulumi.String("string"),
Meta: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
SchedulerConfig: &nomad.NodePoolSchedulerConfigArgs{
MemoryOversubscription: pulumi.String("string"),
SchedulerAlgorithm: pulumi.String("string"),
},
})
var nodePoolResource = new NodePool("nodePoolResource", NodePoolArgs.builder()
.description("string")
.meta(Map.of("string", "string"))
.name("string")
.schedulerConfig(NodePoolSchedulerConfigArgs.builder()
.memoryOversubscription("string")
.schedulerAlgorithm("string")
.build())
.build());
node_pool_resource = nomad.NodePool("nodePoolResource",
description="string",
meta={
"string": "string",
},
name="string",
scheduler_config=nomad.NodePoolSchedulerConfigArgs(
memory_oversubscription="string",
scheduler_algorithm="string",
))
const nodePoolResource = new nomad.NodePool("nodePoolResource", {
description: "string",
meta: {
string: "string",
},
name: "string",
schedulerConfig: {
memoryOversubscription: "string",
schedulerAlgorithm: "string",
},
});
type: nomad:NodePool
properties:
description: string
meta:
string: string
name: string
schedulerConfig:
memoryOversubscription: string
schedulerAlgorithm: string
NodePool Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The NodePool resource accepts the following input properties:
- Description string
(string)
- The description of the node pool.- Meta Dictionary<string, string>
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- Name string
(string)
- The name of the node pool.- Scheduler
Config NodePool Scheduler Config (block)
- Scheduler configuration for the node pool.
- Description string
(string)
- The description of the node pool.- Meta map[string]string
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- Name string
(string)
- The name of the node pool.- Scheduler
Config NodePool Scheduler Config Args (block)
- Scheduler configuration for the node pool.
- description String
(string)
- The description of the node pool.- meta Map<String,String>
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- name String
(string)
- The name of the node pool.- scheduler
Config NodePool Scheduler Config (block)
- Scheduler configuration for the node pool.
- description string
(string)
- The description of the node pool.- meta {[key: string]: string}
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- name string
(string)
- The name of the node pool.- scheduler
Config NodePool Scheduler Config (block)
- Scheduler configuration for the node pool.
- description str
(string)
- The description of the node pool.- meta Mapping[str, str]
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- name str
(string)
- The name of the node pool.- scheduler_
config NodePool Scheduler Config Args (block)
- Scheduler configuration for the node pool.
- description String
(string)
- The description of the node pool.- meta Map<String>
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- name String
(string)
- The name of the node pool.- scheduler
Config Property Map (block)
- Scheduler configuration for the node pool.
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 string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up 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,
description: Optional[str] = None,
meta: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
scheduler_config: Optional[NodePoolSchedulerConfigArgs] = 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)
public static NodePool get(String name, Output<String> id, NodePoolState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Description string
(string)
- The description of the node pool.- Meta Dictionary<string, string>
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- Name string
(string)
- The name of the node pool.- Scheduler
Config NodePool Scheduler Config (block)
- Scheduler configuration for the node pool.
- Description string
(string)
- The description of the node pool.- Meta map[string]string
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- Name string
(string)
- The name of the node pool.- Scheduler
Config NodePool Scheduler Config Args (block)
- Scheduler configuration for the node pool.
- description String
(string)
- The description of the node pool.- meta Map<String,String>
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- name String
(string)
- The name of the node pool.- scheduler
Config NodePool Scheduler Config (block)
- Scheduler configuration for the node pool.
- description string
(string)
- The description of the node pool.- meta {[key: string]: string}
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- name string
(string)
- The name of the node pool.- scheduler
Config NodePool Scheduler Config (block)
- Scheduler configuration for the node pool.
- description str
(string)
- The description of the node pool.- meta Mapping[str, str]
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- name str
(string)
- The name of the node pool.- scheduler_
config NodePool Scheduler Config Args (block)
- Scheduler configuration for the node pool.
- description String
(string)
- The description of the node pool.- meta Map<String>
(map[string]string)
- Arbitrary KV metadata associated with the node pool.- name String
(string)
- The name of the node pool.- scheduler
Config Property Map (block)
- Scheduler configuration for the node pool.
Supporting Types
NodePoolSchedulerConfig, NodePoolSchedulerConfigArgs
- Memory
Oversubscription string (string)
- Whether or not memory oversubscription is enabled in the node pool. Possible values are"enabled"
or"disabled"
. If not defined the global cluster configuration is used.This option differs from Nomad, where it's represented as a boolean, to allow distinguishing between memory oversubscription being disabled in the node pool and this property not being set.
- Scheduler
Algorithm string (string)
- The scheduler algorithm used in the node pool. Possible values arebinpack
orspread
. If not defined the global cluster configuration is used.
- Memory
Oversubscription string (string)
- Whether or not memory oversubscription is enabled in the node pool. Possible values are"enabled"
or"disabled"
. If not defined the global cluster configuration is used.This option differs from Nomad, where it's represented as a boolean, to allow distinguishing between memory oversubscription being disabled in the node pool and this property not being set.
- Scheduler
Algorithm string (string)
- The scheduler algorithm used in the node pool. Possible values arebinpack
orspread
. If not defined the global cluster configuration is used.
- memory
Oversubscription String (string)
- Whether or not memory oversubscription is enabled in the node pool. Possible values are"enabled"
or"disabled"
. If not defined the global cluster configuration is used.This option differs from Nomad, where it's represented as a boolean, to allow distinguishing between memory oversubscription being disabled in the node pool and this property not being set.
- scheduler
Algorithm String (string)
- The scheduler algorithm used in the node pool. Possible values arebinpack
orspread
. If not defined the global cluster configuration is used.
- memory
Oversubscription string (string)
- Whether or not memory oversubscription is enabled in the node pool. Possible values are"enabled"
or"disabled"
. If not defined the global cluster configuration is used.This option differs from Nomad, where it's represented as a boolean, to allow distinguishing between memory oversubscription being disabled in the node pool and this property not being set.
- scheduler
Algorithm string (string)
- The scheduler algorithm used in the node pool. Possible values arebinpack
orspread
. If not defined the global cluster configuration is used.
- memory_
oversubscription str (string)
- Whether or not memory oversubscription is enabled in the node pool. Possible values are"enabled"
or"disabled"
. If not defined the global cluster configuration is used.This option differs from Nomad, where it's represented as a boolean, to allow distinguishing between memory oversubscription being disabled in the node pool and this property not being set.
- scheduler_
algorithm str (string)
- The scheduler algorithm used in the node pool. Possible values arebinpack
orspread
. If not defined the global cluster configuration is used.
- memory
Oversubscription String (string)
- Whether or not memory oversubscription is enabled in the node pool. Possible values are"enabled"
or"disabled"
. If not defined the global cluster configuration is used.This option differs from Nomad, where it's represented as a boolean, to allow distinguishing between memory oversubscription being disabled in the node pool and this property not being set.
- scheduler
Algorithm String (string)
- The scheduler algorithm used in the node pool. Possible values arebinpack
orspread
. If not defined the global cluster configuration is used.
Package Details
- Repository
- HashiCorp Nomad pulumi/pulumi-nomad
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
nomad
Terraform Provider.