Scheduler Config Args
data class SchedulerConfigArgs(val memoryOversubscriptionEnabled: Output<Boolean>? = null, val preemptionConfig: Output<Map<String, Boolean>>? = null, val schedulerAlgorithm: Output<String>? = null) : ConvertibleToJava<SchedulerConfigArgs>
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,
},
});
Content copied to clipboard
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,
})
Content copied to clipboard
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 },
},
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
Constructors
Properties
Link copied to clipboard
(bool: false)
- When true
, tasks may exceed their reserved memory limit.
Link copied to clipboard
(map[string]bool)
- Options to enable preemption for various schedulers.
Link copied to clipboard
(string: "binpack")
- Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values are binpack
and spread
.