nomad.SchedulerConfig
Explore with Pulumi AI
Manages scheduler configuration of the Nomad cluster.
Warning: destroying this resource will not have any effect in the cluster configuration, since there’s no clear definition of what a destroy action should do. The cluster will be left as-is and only the state reference will be removed.
Example Usage
Set cluster scheduler configuration:
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";
const config = new nomad.SchedulerConfig("config", {
schedulerAlgorithm: "spread",
memoryOversubscriptionEnabled: true,
preemptionConfig: {
system_scheduler_enabled: true,
batch_scheduler_enabled: true,
service_scheduler_enabled: true,
sysbatch_scheduler_enabled: true,
},
});
import pulumi
import pulumi_nomad as nomad
config = nomad.SchedulerConfig("config",
scheduler_algorithm="spread",
memory_oversubscription_enabled=True,
preemption_config={
"system_scheduler_enabled": True,
"batch_scheduler_enabled": True,
"service_scheduler_enabled": True,
"sysbatch_scheduler_enabled": True,
})
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.NewSchedulerConfig(ctx, "config", &nomad.SchedulerConfigArgs{
SchedulerAlgorithm: pulumi.String("spread"),
MemoryOversubscriptionEnabled: pulumi.Bool(true),
PreemptionConfig: pulumi.BoolMap{
"system_scheduler_enabled": pulumi.Bool(true),
"batch_scheduler_enabled": pulumi.Bool(true),
"service_scheduler_enabled": pulumi.Bool(true),
"sysbatch_scheduler_enabled": pulumi.Bool(true),
},
})
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 config = new Nomad.SchedulerConfig("config", new()
{
SchedulerAlgorithm = "spread",
MemoryOversubscriptionEnabled = true,
PreemptionConfig =
{
{ "system_scheduler_enabled", true },
{ "batch_scheduler_enabled", true },
{ "service_scheduler_enabled", true },
{ "sysbatch_scheduler_enabled", true },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nomad.SchedulerConfig;
import com.pulumi.nomad.SchedulerConfigArgs;
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 config = new SchedulerConfig("config", SchedulerConfigArgs.builder()
.schedulerAlgorithm("spread")
.memoryOversubscriptionEnabled(true)
.preemptionConfig(Map.ofEntries(
Map.entry("system_scheduler_enabled", true),
Map.entry("batch_scheduler_enabled", true),
Map.entry("service_scheduler_enabled", true),
Map.entry("sysbatch_scheduler_enabled", true)
))
.build());
}
}
resources:
config:
type: nomad:SchedulerConfig
properties:
schedulerAlgorithm: spread
memoryOversubscriptionEnabled: true
preemptionConfig:
system_scheduler_enabled: true
batch_scheduler_enabled: true
service_scheduler_enabled: true
sysbatch_scheduler_enabled: true
Create SchedulerConfig Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SchedulerConfig(name: string, args?: SchedulerConfigArgs, opts?: CustomResourceOptions);
@overload
def SchedulerConfig(resource_name: str,
args: Optional[SchedulerConfigArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def SchedulerConfig(resource_name: str,
opts: Optional[ResourceOptions] = None,
memory_oversubscription_enabled: Optional[bool] = None,
preemption_config: Optional[Mapping[str, bool]] = None,
scheduler_algorithm: Optional[str] = None)
func NewSchedulerConfig(ctx *Context, name string, args *SchedulerConfigArgs, opts ...ResourceOption) (*SchedulerConfig, error)
public SchedulerConfig(string name, SchedulerConfigArgs? args = null, CustomResourceOptions? opts = null)
public SchedulerConfig(String name, SchedulerConfigArgs args)
public SchedulerConfig(String name, SchedulerConfigArgs args, CustomResourceOptions options)
type: nomad:SchedulerConfig
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 SchedulerConfigArgs
- 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 SchedulerConfigArgs
- 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 SchedulerConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SchedulerConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SchedulerConfigArgs
- 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 schedulerConfigResource = new Nomad.SchedulerConfig("schedulerConfigResource", new()
{
MemoryOversubscriptionEnabled = false,
PreemptionConfig =
{
{ "string", false },
},
SchedulerAlgorithm = "string",
});
example, err := nomad.NewSchedulerConfig(ctx, "schedulerConfigResource", &nomad.SchedulerConfigArgs{
MemoryOversubscriptionEnabled: pulumi.Bool(false),
PreemptionConfig: pulumi.BoolMap{
"string": pulumi.Bool(false),
},
SchedulerAlgorithm: pulumi.String("string"),
})
var schedulerConfigResource = new SchedulerConfig("schedulerConfigResource", SchedulerConfigArgs.builder()
.memoryOversubscriptionEnabled(false)
.preemptionConfig(Map.of("string", false))
.schedulerAlgorithm("string")
.build());
scheduler_config_resource = nomad.SchedulerConfig("schedulerConfigResource",
memory_oversubscription_enabled=False,
preemption_config={
"string": False,
},
scheduler_algorithm="string")
const schedulerConfigResource = new nomad.SchedulerConfig("schedulerConfigResource", {
memoryOversubscriptionEnabled: false,
preemptionConfig: {
string: false,
},
schedulerAlgorithm: "string",
});
type: nomad:SchedulerConfig
properties:
memoryOversubscriptionEnabled: false
preemptionConfig:
string: false
schedulerAlgorithm: string
SchedulerConfig 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 SchedulerConfig resource accepts the following input properties:
- Memory
Oversubscription boolEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- Preemption
Config Dictionary<string, bool> (map[string]bool)
- Options to enable preemption for various schedulers.- Scheduler
Algorithm string (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- Memory
Oversubscription boolEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- Preemption
Config map[string]bool (map[string]bool)
- Options to enable preemption for various schedulers.- Scheduler
Algorithm string (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- memory
Oversubscription BooleanEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- preemption
Config Map<String,Boolean> (map[string]bool)
- Options to enable preemption for various schedulers.- scheduler
Algorithm String (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- memory
Oversubscription booleanEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- preemption
Config {[key: string]: boolean} (map[string]bool)
- Options to enable preemption for various schedulers.- scheduler
Algorithm string (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- memory_
oversubscription_ boolenabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- preemption_
config Mapping[str, bool] (map[string]bool)
- Options to enable preemption for various schedulers.- scheduler_
algorithm str (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- memory
Oversubscription BooleanEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- preemption
Config Map<Boolean> (map[string]bool)
- Options to enable preemption for various schedulers.- scheduler
Algorithm String (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
Outputs
All input properties are implicitly available as output properties. Additionally, the SchedulerConfig 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 SchedulerConfig Resource
Get an existing SchedulerConfig 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?: SchedulerConfigState, opts?: CustomResourceOptions): SchedulerConfig
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
memory_oversubscription_enabled: Optional[bool] = None,
preemption_config: Optional[Mapping[str, bool]] = None,
scheduler_algorithm: Optional[str] = None) -> SchedulerConfig
func GetSchedulerConfig(ctx *Context, name string, id IDInput, state *SchedulerConfigState, opts ...ResourceOption) (*SchedulerConfig, error)
public static SchedulerConfig Get(string name, Input<string> id, SchedulerConfigState? state, CustomResourceOptions? opts = null)
public static SchedulerConfig get(String name, Output<String> id, SchedulerConfigState 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.
- Memory
Oversubscription boolEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- Preemption
Config Dictionary<string, bool> (map[string]bool)
- Options to enable preemption for various schedulers.- Scheduler
Algorithm string (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- Memory
Oversubscription boolEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- Preemption
Config map[string]bool (map[string]bool)
- Options to enable preemption for various schedulers.- Scheduler
Algorithm string (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- memory
Oversubscription BooleanEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- preemption
Config Map<String,Boolean> (map[string]bool)
- Options to enable preemption for various schedulers.- scheduler
Algorithm String (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- memory
Oversubscription booleanEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- preemption
Config {[key: string]: boolean} (map[string]bool)
- Options to enable preemption for various schedulers.- scheduler
Algorithm string (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- memory_
oversubscription_ boolenabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- preemption_
config Mapping[str, bool] (map[string]bool)
- Options to enable preemption for various schedulers.- scheduler_
algorithm str (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
- memory
Oversubscription BooleanEnabled (bool: false)
- Whentrue
, tasks may exceed their reserved memory limit.- preemption
Config Map<Boolean> (map[string]bool)
- Options to enable preemption for various schedulers.- scheduler
Algorithm String (string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values arebinpack
andspread
.
Package Details
- Repository
- HashiCorp Nomad pulumi/pulumi-nomad
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
nomad
Terraform Provider.