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

com.pulumi.kubernetes.policy.v1beta1.kotlin.outputs.PodDisruptionBudgetSpec.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.v1beta1.kotlin.outputs

import com.pulumi.core.Either
import com.pulumi.kubernetes.meta.v1.kotlin.outputs.LabelSelector
import kotlin.Int
import kotlin.String
import kotlin.Suppress

/**
 * PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
 * @property maxUnavailable An eviction is allowed if at most "maxUnavailable" pods selected by "selector" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with "minAvailable".
 * @property minAvailable An eviction is allowed if at least "minAvailable" pods selected by "selector" will still be available after the eviction, i.e. even in the absence of the evicted pod.  So for example you can prevent all voluntary evictions by specifying "100%".
 * @property selector Label query over pods whose evictions are managed by the disruption budget.
 */
public data class PodDisruptionBudgetSpec(
    public val maxUnavailable: Either? = null,
    public val minAvailable: Either? = null,
    public val selector: LabelSelector? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.kubernetes.policy.v1beta1.outputs.PodDisruptionBudgetSpec): PodDisruptionBudgetSpec = PodDisruptionBudgetSpec(
            maxUnavailable = javaType.maxUnavailable().map({ args0 ->
                args0.transform(
                    { args0 -> args0 },
                    { args0 -> args0 },
                )
            }).orElse(null),
            minAvailable = javaType.minAvailable().map({ args0 ->
                args0.transform({ args0 -> args0 }, { args0 ->
                    args0
                })
            }).orElse(null),
            selector = javaType.selector().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.meta.v1.kotlin.outputs.LabelSelector.Companion.toKotlin(args0)
                })
            }).orElse(null),
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy