com.pulumi.nomad.kotlin.SchedulerConfigArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-nomad-kotlin Show documentation
Show all versions of pulumi-nomad-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.nomad.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.nomad.SchedulerConfigArgs.builder
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* 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:
*
* ```typescript
* 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,
* },
* });
* ```
* ```python
* 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,
* })
* ```
* ```csharp
* 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 },
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* @property memoryOversubscriptionEnabled `(bool: false)` - When `true`, tasks may exceed their reserved memory limit.
* @property preemptionConfig `(map[string]bool)` - Options to enable preemption for various schedulers.
* @property schedulerAlgorithm `(string: "binpack")` - Specifies whether scheduler binpacks or spreads allocations on available nodes. Possible values are `binpack` and `spread`.
*/
public data class SchedulerConfigArgs(
public val memoryOversubscriptionEnabled: Output? = null,
public val preemptionConfig: Output