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

com.pulumi.kubernetes.policy.v1.kotlin.inputs.PodDisruptionBudgetStatusArgs.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.policy.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.meta.v1.kotlin.inputs.ConditionArgs
import com.pulumi.kubernetes.meta.v1.kotlin.inputs.ConditionArgsBuilder
import com.pulumi.kubernetes.policy.v1.inputs.PodDisruptionBudgetStatusArgs.builder
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.
 * @property conditions Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute
 *               the number of allowed disruptions. Therefore no disruptions are
 *               allowed and the status of the condition will be False.
 * - InsufficientPods: The number of pods are either at or below the number
 *                     required by the PodDisruptionBudget. No disruptions are
 *                     allowed and the status of the condition will be False.
 * - SufficientPods: There are more pods than required by the PodDisruptionBudget.
 *                   The condition will be True, and the number of allowed
 *                   disruptions are provided by the disruptionsAllowed property.
 * @property currentHealthy current number of healthy pods
 * @property desiredHealthy minimum desired number of healthy pods
 * @property disruptedPods DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions.
 * @property disruptionsAllowed Number of pod disruptions that are currently allowed.
 * @property expectedPods total number of pods counted by this disruption budget
 * @property observedGeneration Most recent generation observed when updating this PDB status. DisruptionsAllowed and other status information is valid only if observedGeneration equals to PDB's object generation.
 */
public data class PodDisruptionBudgetStatusArgs(
    public val conditions: Output>? = null,
    public val currentHealthy: Output,
    public val desiredHealthy: Output,
    public val disruptedPods: Output>? = null,
    public val disruptionsAllowed: Output,
    public val expectedPods: Output,
    public val observedGeneration: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.policy.v1.inputs.PodDisruptionBudgetStatusArgs =
        com.pulumi.kubernetes.policy.v1.inputs.PodDisruptionBudgetStatusArgs.builder()
            .conditions(
                conditions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .currentHealthy(currentHealthy.applyValue({ args0 -> args0 }))
            .desiredHealthy(desiredHealthy.applyValue({ args0 -> args0 }))
            .disruptedPods(
                disruptedPods?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .disruptionsAllowed(disruptionsAllowed.applyValue({ args0 -> args0 }))
            .expectedPods(expectedPods.applyValue({ args0 -> args0 }))
            .observedGeneration(observedGeneration?.applyValue({ args0 -> args0 })).build()
}

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

    private var currentHealthy: Output? = null

    private var desiredHealthy: Output? = null

    private var disruptedPods: Output>? = null

    private var disruptionsAllowed: Output? = null

    private var expectedPods: Output? = null

    private var observedGeneration: Output? = null

    /**
     * @param value Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute
     *               the number of allowed disruptions. Therefore no disruptions are
     *               allowed and the status of the condition will be False.
     * - InsufficientPods: The number of pods are either at or below the number
     *                     required by the PodDisruptionBudget. No disruptions are
     *                     allowed and the status of the condition will be False.
     * - SufficientPods: There are more pods than required by the PodDisruptionBudget.
     *                   The condition will be True, and the number of allowed
     *                   disruptions are provided by the disruptionsAllowed property.
     */
    @JvmName("fvsnrdxxufqnvkyi")
    public suspend fun conditions(`value`: Output>) {
        this.conditions = value
    }

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

    /**
     * @param values Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute
     *               the number of allowed disruptions. Therefore no disruptions are
     *               allowed and the status of the condition will be False.
     * - InsufficientPods: The number of pods are either at or below the number
     *                     required by the PodDisruptionBudget. No disruptions are
     *                     allowed and the status of the condition will be False.
     * - SufficientPods: There are more pods than required by the PodDisruptionBudget.
     *                   The condition will be True, and the number of allowed
     *                   disruptions are provided by the disruptionsAllowed property.
     */
    @JvmName("glccrnthtrbmuneh")
    public suspend fun conditions(values: List>) {
        this.conditions = Output.all(values)
    }

    /**
     * @param value current number of healthy pods
     */
    @JvmName("ttmpqkgukjoehoay")
    public suspend fun currentHealthy(`value`: Output) {
        this.currentHealthy = value
    }

    /**
     * @param value minimum desired number of healthy pods
     */
    @JvmName("mtgqvfnmjpvuavxe")
    public suspend fun desiredHealthy(`value`: Output) {
        this.desiredHealthy = value
    }

    /**
     * @param value DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions.
     */
    @JvmName("eakjfujhiqofnjgn")
    public suspend fun disruptedPods(`value`: Output>) {
        this.disruptedPods = value
    }

    /**
     * @param value Number of pod disruptions that are currently allowed.
     */
    @JvmName("iralpwrfkdifibko")
    public suspend fun disruptionsAllowed(`value`: Output) {
        this.disruptionsAllowed = value
    }

    /**
     * @param value total number of pods counted by this disruption budget
     */
    @JvmName("cbwyxpaenkquxfgw")
    public suspend fun expectedPods(`value`: Output) {
        this.expectedPods = value
    }

    /**
     * @param value Most recent generation observed when updating this PDB status. DisruptionsAllowed and other status information is valid only if observedGeneration equals to PDB's object generation.
     */
    @JvmName("anjkrpsqmahvtgxc")
    public suspend fun observedGeneration(`value`: Output) {
        this.observedGeneration = value
    }

    /**
     * @param value Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute
     *               the number of allowed disruptions. Therefore no disruptions are
     *               allowed and the status of the condition will be False.
     * - InsufficientPods: The number of pods are either at or below the number
     *                     required by the PodDisruptionBudget. No disruptions are
     *                     allowed and the status of the condition will be False.
     * - SufficientPods: There are more pods than required by the PodDisruptionBudget.
     *                   The condition will be True, and the number of allowed
     *                   disruptions are provided by the disruptionsAllowed property.
     */
    @JvmName("jtiangcbedbirmot")
    public suspend fun conditions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.conditions = mapped
    }

    /**
     * @param argument Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute
     *               the number of allowed disruptions. Therefore no disruptions are
     *               allowed and the status of the condition will be False.
     * - InsufficientPods: The number of pods are either at or below the number
     *                     required by the PodDisruptionBudget. No disruptions are
     *                     allowed and the status of the condition will be False.
     * - SufficientPods: There are more pods than required by the PodDisruptionBudget.
     *                   The condition will be True, and the number of allowed
     *                   disruptions are provided by the disruptionsAllowed property.
     */
    @JvmName("fdluqyaskmshvcnm")
    public suspend fun conditions(argument: List Unit>) {
        val toBeMapped = argument.toList().map { ConditionArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.conditions = mapped
    }

    /**
     * @param argument Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute
     *               the number of allowed disruptions. Therefore no disruptions are
     *               allowed and the status of the condition will be False.
     * - InsufficientPods: The number of pods are either at or below the number
     *                     required by the PodDisruptionBudget. No disruptions are
     *                     allowed and the status of the condition will be False.
     * - SufficientPods: There are more pods than required by the PodDisruptionBudget.
     *                   The condition will be True, and the number of allowed
     *                   disruptions are provided by the disruptionsAllowed property.
     */
    @JvmName("iieyqvfkbtubqprh")
    public suspend fun conditions(vararg argument: suspend ConditionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { ConditionArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.conditions = mapped
    }

    /**
     * @param argument Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute
     *               the number of allowed disruptions. Therefore no disruptions are
     *               allowed and the status of the condition will be False.
     * - InsufficientPods: The number of pods are either at or below the number
     *                     required by the PodDisruptionBudget. No disruptions are
     *                     allowed and the status of the condition will be False.
     * - SufficientPods: There are more pods than required by the PodDisruptionBudget.
     *                   The condition will be True, and the number of allowed
     *                   disruptions are provided by the disruptionsAllowed property.
     */
    @JvmName("sowoybaummkmsosf")
    public suspend fun conditions(argument: suspend ConditionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ConditionArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.conditions = mapped
    }

    /**
     * @param values Conditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute
     *               the number of allowed disruptions. Therefore no disruptions are
     *               allowed and the status of the condition will be False.
     * - InsufficientPods: The number of pods are either at or below the number
     *                     required by the PodDisruptionBudget. No disruptions are
     *                     allowed and the status of the condition will be False.
     * - SufficientPods: There are more pods than required by the PodDisruptionBudget.
     *                   The condition will be True, and the number of allowed
     *                   disruptions are provided by the disruptionsAllowed property.
     */
    @JvmName("fcnkvnrdchvnwvts")
    public suspend fun conditions(vararg values: ConditionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.conditions = mapped
    }

    /**
     * @param value current number of healthy pods
     */
    @JvmName("ucppfgrygkrcjaqr")
    public suspend fun currentHealthy(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.currentHealthy = mapped
    }

    /**
     * @param value minimum desired number of healthy pods
     */
    @JvmName("xfblfsnbisaerlky")
    public suspend fun desiredHealthy(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.desiredHealthy = mapped
    }

    /**
     * @param value DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions.
     */
    @JvmName("mcowywhauvvgyawt")
    public suspend fun disruptedPods(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disruptedPods = mapped
    }

    /**
     * @param values DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions.
     */
    @JvmName("qalpqglfwdgfpymu")
    public fun disruptedPods(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.disruptedPods = mapped
    }

    /**
     * @param value Number of pod disruptions that are currently allowed.
     */
    @JvmName("wuexxwftieitelps")
    public suspend fun disruptionsAllowed(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.disruptionsAllowed = mapped
    }

    /**
     * @param value total number of pods counted by this disruption budget
     */
    @JvmName("aqqpybyfionxrkcw")
    public suspend fun expectedPods(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.expectedPods = mapped
    }

    /**
     * @param value Most recent generation observed when updating this PDB status. DisruptionsAllowed and other status information is valid only if observedGeneration equals to PDB's object generation.
     */
    @JvmName("hcyfocwucvaymyfr")
    public suspend fun observedGeneration(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.observedGeneration = mapped
    }

    internal fun build(): PodDisruptionBudgetStatusArgs = PodDisruptionBudgetStatusArgs(
        conditions = conditions,
        currentHealthy = currentHealthy ?: throw PulumiNullFieldException("currentHealthy"),
        desiredHealthy = desiredHealthy ?: throw PulumiNullFieldException("desiredHealthy"),
        disruptedPods = disruptedPods,
        disruptionsAllowed = disruptionsAllowed ?: throw PulumiNullFieldException("disruptionsAllowed"),
        expectedPods = expectedPods ?: throw PulumiNullFieldException("expectedPods"),
        observedGeneration = observedGeneration,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy