com.pulumi.kubernetes.policy.v1.kotlin.inputs.PodDisruptionBudgetSpecArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-kubernetes-kotlin Show documentation
Show all versions of pulumi-kubernetes-kotlin Show documentation
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.policy.v1.kotlin.inputs
import com.pulumi.core.Either
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.meta.v1.kotlin.inputs.LabelSelectorArgs
import com.pulumi.kubernetes.meta.v1.kotlin.inputs.LabelSelectorArgsBuilder
import com.pulumi.kubernetes.policy.v1.inputs.PodDisruptionBudgetSpecArgs.builder
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* 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. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.
* @property unhealthyPodEvictionPolicy UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type="Ready",status="True".
* Valid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.
* IfHealthyBudget policy means that running pods (status.phase="Running"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.
* AlwaysAllow policy means that all running pods (status.phase="Running"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.
* Additional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.
* This field is beta-level. The eviction API uses this field when the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).
*/
public data class PodDisruptionBudgetSpecArgs(
public val maxUnavailable: Output>? = null,
public val minAvailable: Output>? = null,
public val selector: Output? = null,
public val unhealthyPodEvictionPolicy: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.kubernetes.policy.v1.inputs.PodDisruptionBudgetSpecArgs =
com.pulumi.kubernetes.policy.v1.inputs.PodDisruptionBudgetSpecArgs.builder()
.maxUnavailable(
maxUnavailable?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0
})
}),
)
.minAvailable(
minAvailable?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0
})
}),
)
.selector(selector?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.unhealthyPodEvictionPolicy(unhealthyPodEvictionPolicy?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [PodDisruptionBudgetSpecArgs].
*/
@PulumiTagMarker
public class PodDisruptionBudgetSpecArgsBuilder internal constructor() {
private var maxUnavailable: Output>? = null
private var minAvailable: Output>? = null
private var selector: Output? = null
private var unhealthyPodEvictionPolicy: Output? = null
/**
* @param value 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".
*/
@JvmName("swebsixuosmljorr")
public suspend fun maxUnavailable(`value`: Output>) {
this.maxUnavailable = value
}
/**
* @param value 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%".
*/
@JvmName("evsffkoaryerwbnm")
public suspend fun minAvailable(`value`: Output>) {
this.minAvailable = value
}
/**
* @param value Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.
*/
@JvmName("nhtpneqbanltbbmc")
public suspend fun selector(`value`: Output) {
this.selector = value
}
/**
* @param value UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type="Ready",status="True".
* Valid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.
* IfHealthyBudget policy means that running pods (status.phase="Running"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.
* AlwaysAllow policy means that all running pods (status.phase="Running"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.
* Additional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.
* This field is beta-level. The eviction API uses this field when the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).
*/
@JvmName("hsmawjsjoctrerov")
public suspend fun unhealthyPodEvictionPolicy(`value`: Output) {
this.unhealthyPodEvictionPolicy = value
}
/**
* @param value 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".
*/
@JvmName("yttouosqlwerybbs")
public suspend fun maxUnavailable(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.maxUnavailable = mapped
}
/**
* @param value 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".
*/
@JvmName("uahrdewiupgptoih")
public fun maxUnavailable(`value`: Int) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.maxUnavailable = mapped
}
/**
* @param value 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".
*/
@JvmName("ikqdbaevwmxquipc")
public fun maxUnavailable(`value`: String) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.maxUnavailable = mapped
}
/**
* @param value 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%".
*/
@JvmName("goeennierwqftbeh")
public suspend fun minAvailable(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.minAvailable = mapped
}
/**
* @param value 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%".
*/
@JvmName("fkgtskshntnxssgf")
public fun minAvailable(`value`: Int) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.minAvailable = mapped
}
/**
* @param value 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%".
*/
@JvmName("jmcufkqktriuqqso")
public fun minAvailable(`value`: String) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.minAvailable = mapped
}
/**
* @param value Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.
*/
@JvmName("pdrcjfracenkbmvu")
public suspend fun selector(`value`: LabelSelectorArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.selector = mapped
}
/**
* @param argument Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.
*/
@JvmName("ppjoomwmbvavtjtt")
public suspend fun selector(argument: suspend LabelSelectorArgsBuilder.() -> Unit) {
val toBeMapped = LabelSelectorArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.selector = mapped
}
/**
* @param value UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type="Ready",status="True".
* Valid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.
* IfHealthyBudget policy means that running pods (status.phase="Running"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.
* AlwaysAllow policy means that all running pods (status.phase="Running"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.
* Additional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.
* This field is beta-level. The eviction API uses this field when the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).
*/
@JvmName("tfhvwtbktueiyhcw")
public suspend fun unhealthyPodEvictionPolicy(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.unhealthyPodEvictionPolicy = mapped
}
internal fun build(): PodDisruptionBudgetSpecArgs = PodDisruptionBudgetSpecArgs(
maxUnavailable = maxUnavailable,
minAvailable = minAvailable,
selector = selector,
unhealthyPodEvictionPolicy = unhealthyPodEvictionPolicy,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy