All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.kubernetes.node.v1alpha1.kotlin.inputs.SchedulingArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.node.v1alpha1.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import com.pulumi.kubernetes.core.v1.kotlin.inputs.TolerationArgs
import com.pulumi.kubernetes.core.v1.kotlin.inputs.TolerationArgsBuilder
import com.pulumi.kubernetes.node.v1alpha1.inputs.SchedulingArgs.builder
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.
 * @property nodeSelector nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.
 * @property tolerations tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
 */
public data class SchedulingArgs(
    public val nodeSelector: Output>? = null,
    public val tolerations: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.node.v1alpha1.inputs.SchedulingArgs =
        com.pulumi.kubernetes.node.v1alpha1.inputs.SchedulingArgs.builder()
            .nodeSelector(
                nodeSelector?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .tolerations(
                tolerations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [SchedulingArgs].
 */
@PulumiTagMarker
public class SchedulingArgsBuilder internal constructor() {
    private var nodeSelector: Output>? = null

    private var tolerations: Output>? = null

    /**
     * @param value nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.
     */
    @JvmName("khmrypinapqxdyjt")
    public suspend fun nodeSelector(`value`: Output>) {
        this.nodeSelector = value
    }

    /**
     * @param value tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
     */
    @JvmName("xqpppfqcgsbhwpba")
    public suspend fun tolerations(`value`: Output>) {
        this.tolerations = value
    }

    @JvmName("ngbnsphwtigujmpn")
    public suspend fun tolerations(vararg values: Output) {
        this.tolerations = Output.all(values.asList())
    }

    /**
     * @param values tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
     */
    @JvmName("okxrnvabyeddrmhx")
    public suspend fun tolerations(values: List>) {
        this.tolerations = Output.all(values)
    }

    /**
     * @param value nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.
     */
    @JvmName("jjmsrmmsncdfopoq")
    public suspend fun nodeSelector(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nodeSelector = mapped
    }

    /**
     * @param values nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.
     */
    @JvmName("mufjcolwmduwfouj")
    public fun nodeSelector(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.nodeSelector = mapped
    }

    /**
     * @param value tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
     */
    @JvmName("bdhwafuilqisgseq")
    public suspend fun tolerations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tolerations = mapped
    }

    /**
     * @param argument tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
     */
    @JvmName("qldrymlxefrgjxki")
    public suspend fun tolerations(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TolerationArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tolerations = mapped
    }

    /**
     * @param argument tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
     */
    @JvmName("lcxgnildaisqmveo")
    public suspend fun tolerations(vararg argument: suspend TolerationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TolerationArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tolerations = mapped
    }

    /**
     * @param argument tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
     */
    @JvmName("dbbrwtkrkkccqdlv")
    public suspend fun tolerations(argument: suspend TolerationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TolerationArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tolerations = mapped
    }

    /**
     * @param values tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.
     */
    @JvmName("rrujffleillpdnvs")
    public suspend fun tolerations(vararg values: TolerationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tolerations = mapped
    }

    internal fun build(): SchedulingArgs = SchedulingArgs(
        nodeSelector = nodeSelector,
        tolerations = tolerations,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy