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

com.pulumi.kubernetes.node.v1.kotlin.inputs.SchedulingPatchArgs.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.

There is a newer version: 4.18.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.node.v1.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.TolerationPatchArgs
import com.pulumi.kubernetes.core.v1.kotlin.inputs.TolerationPatchArgsBuilder
import com.pulumi.kubernetes.node.v1.inputs.SchedulingPatchArgs.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 SchedulingPatchArgs(
    public val nodeSelector: Output>? = null,
    public val tolerations: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.node.v1.inputs.SchedulingPatchArgs =
        com.pulumi.kubernetes.node.v1.inputs.SchedulingPatchArgs.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 [SchedulingPatchArgs].
 */
@PulumiTagMarker
public class SchedulingPatchArgsBuilder 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("xxoualmtidhlrjng")
    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("udyxjibmsymvhcjy")
    public suspend fun tolerations(`value`: Output>) {
        this.tolerations = value
    }

    @JvmName("lxwbogsetwjrbnqy")
    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("ttexwpskkfoojxlj")
    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("wbfqpvmwgeekoxlh")
    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("uqrybfcrcfmhbaca")
    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("shsyybecnlcpxgim")
    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("tmgguxewdsirxqoc")
    public suspend fun tolerations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TolerationPatchArgsBuilder().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("gmynnvocufkusacw")
    public suspend fun tolerations(vararg argument: suspend TolerationPatchArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TolerationPatchArgsBuilder().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("hswfinbtoxevflrp")
    public suspend fun tolerations(argument: suspend TolerationPatchArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TolerationPatchArgsBuilder().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("stskigvnrmcgwfak")
    public suspend fun tolerations(vararg values: TolerationPatchArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tolerations = mapped
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy