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

com.pulumi.kubernetes.apps.v1.kotlin.inputs.DaemonSetSpecArgs.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.apps.v1.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import com.pulumi.kubernetes.apps.v1.inputs.DaemonSetSpecArgs.builder
import com.pulumi.kubernetes.core.v1.kotlin.inputs.PodTemplateSpecArgs
import com.pulumi.kubernetes.core.v1.kotlin.inputs.PodTemplateSpecArgsBuilder
import com.pulumi.kubernetes.meta.v1.kotlin.inputs.LabelSelectorArgs
import com.pulumi.kubernetes.meta.v1.kotlin.inputs.LabelSelectorArgsBuilder
import kotlin.Int
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * DaemonSetSpec is the specification of a daemon set.
 * @property minReadySeconds The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).
 * @property revisionHistoryLimit The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.
 * @property selector A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
 * @property template An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). The only allowed template.spec.restartPolicy value is "Always". More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
 * @property updateStrategy An update strategy to replace existing DaemonSet pods with new pods.
 */
public data class DaemonSetSpecArgs(
    public val minReadySeconds: Output? = null,
    public val revisionHistoryLimit: Output? = null,
    public val selector: Output,
    public val template: Output,
    public val updateStrategy: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.apps.v1.inputs.DaemonSetSpecArgs =
        com.pulumi.kubernetes.apps.v1.inputs.DaemonSetSpecArgs.builder()
            .minReadySeconds(minReadySeconds?.applyValue({ args0 -> args0 }))
            .revisionHistoryLimit(revisionHistoryLimit?.applyValue({ args0 -> args0 }))
            .selector(selector.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .template(template.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .updateStrategy(
                updateStrategy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [DaemonSetSpecArgs].
 */
@PulumiTagMarker
public class DaemonSetSpecArgsBuilder internal constructor() {
    private var minReadySeconds: Output? = null

    private var revisionHistoryLimit: Output? = null

    private var selector: Output? = null

    private var template: Output? = null

    private var updateStrategy: Output? = null

    /**
     * @param value The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).
     */
    @JvmName("qihhqvcmoblfiplx")
    public suspend fun minReadySeconds(`value`: Output) {
        this.minReadySeconds = value
    }

    /**
     * @param value The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.
     */
    @JvmName("mqmhganfgmbfxdir")
    public suspend fun revisionHistoryLimit(`value`: Output) {
        this.revisionHistoryLimit = value
    }

    /**
     * @param value A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
     */
    @JvmName("ynmutfgimvbrsofo")
    public suspend fun selector(`value`: Output) {
        this.selector = value
    }

    /**
     * @param value An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). The only allowed template.spec.restartPolicy value is "Always". More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
     */
    @JvmName("vjxucdshoslpaoxf")
    public suspend fun template(`value`: Output) {
        this.template = value
    }

    /**
     * @param value An update strategy to replace existing DaemonSet pods with new pods.
     */
    @JvmName("ojxbleypoylcsypg")
    public suspend fun updateStrategy(`value`: Output) {
        this.updateStrategy = value
    }

    /**
     * @param value The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).
     */
    @JvmName("yvspbfloaindfjna")
    public suspend fun minReadySeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minReadySeconds = mapped
    }

    /**
     * @param value The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.
     */
    @JvmName("xgiactcekvenlvct")
    public suspend fun revisionHistoryLimit(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.revisionHistoryLimit = mapped
    }

    /**
     * @param value A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
     */
    @JvmName("nxplkdhvldibxard")
    public suspend fun selector(`value`: LabelSelectorArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.selector = mapped
    }

    /**
     * @param argument A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
     */
    @JvmName("sjnccsfxqfqunrps")
    public suspend fun selector(argument: suspend LabelSelectorArgsBuilder.() -> Unit) {
        val toBeMapped = LabelSelectorArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.selector = mapped
    }

    /**
     * @param value An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). The only allowed template.spec.restartPolicy value is "Always". More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
     */
    @JvmName("gpvhbpqofoparajg")
    public suspend fun template(`value`: PodTemplateSpecArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.template = mapped
    }

    /**
     * @param argument An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). The only allowed template.spec.restartPolicy value is "Always". More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
     */
    @JvmName("axidgeqhxibocdwf")
    public suspend fun template(argument: suspend PodTemplateSpecArgsBuilder.() -> Unit) {
        val toBeMapped = PodTemplateSpecArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.template = mapped
    }

    /**
     * @param value An update strategy to replace existing DaemonSet pods with new pods.
     */
    @JvmName("oniumnquiwghyjot")
    public suspend fun updateStrategy(`value`: DaemonSetUpdateStrategyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.updateStrategy = mapped
    }

    /**
     * @param argument An update strategy to replace existing DaemonSet pods with new pods.
     */
    @JvmName("aqeedilijgviqvqe")
    public suspend fun updateStrategy(argument: suspend DaemonSetUpdateStrategyArgsBuilder.() -> Unit) {
        val toBeMapped = DaemonSetUpdateStrategyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.updateStrategy = mapped
    }

    internal fun build(): DaemonSetSpecArgs = DaemonSetSpecArgs(
        minReadySeconds = minReadySeconds,
        revisionHistoryLimit = revisionHistoryLimit,
        selector = selector ?: throw PulumiNullFieldException("selector"),
        template = template ?: throw PulumiNullFieldException("template"),
        updateStrategy = updateStrategy,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy