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

com.pulumi.kubernetes.policy.v1beta1.outputs.PodDisruptionBudgetSpec Maven / Gradle / Ivy

There is a newer version: 4.19.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.kubernetes.policy.v1beta1.outputs;

import com.pulumi.core.Either;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.kubernetes.meta.v1.outputs.LabelSelector;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class PodDisruptionBudgetSpec {
    /**
     * @return 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".
     * 
     */
    private @Nullable Either maxUnavailable;
    /**
     * @return 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%".
     * 
     */
    private @Nullable Either minAvailable;
    /**
     * @return Label query over pods whose evictions are managed by the disruption budget.
     * 
     */
    private @Nullable LabelSelector selector;

    private PodDisruptionBudgetSpec() {}
    /**
     * @return 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".
     * 
     */
    public Optional> maxUnavailable() {
        return Optional.ofNullable(this.maxUnavailable);
    }
    /**
     * @return 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%".
     * 
     */
    public Optional> minAvailable() {
        return Optional.ofNullable(this.minAvailable);
    }
    /**
     * @return Label query over pods whose evictions are managed by the disruption budget.
     * 
     */
    public Optional selector() {
        return Optional.ofNullable(this.selector);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(PodDisruptionBudgetSpec defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable Either maxUnavailable;
        private @Nullable Either minAvailable;
        private @Nullable LabelSelector selector;
        public Builder() {}
        public Builder(PodDisruptionBudgetSpec defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.maxUnavailable = defaults.maxUnavailable;
    	      this.minAvailable = defaults.minAvailable;
    	      this.selector = defaults.selector;
        }

        @CustomType.Setter
        public Builder maxUnavailable(@Nullable Either maxUnavailable) {

            this.maxUnavailable = maxUnavailable;
            return this;
        }
        @CustomType.Setter
        public Builder minAvailable(@Nullable Either minAvailable) {

            this.minAvailable = minAvailable;
            return this;
        }
        @CustomType.Setter
        public Builder selector(@Nullable LabelSelector selector) {

            this.selector = selector;
            return this;
        }
        public PodDisruptionBudgetSpec build() {
            final var _resultValue = new PodDisruptionBudgetSpec();
            _resultValue.maxUnavailable = maxUnavailable;
            _resultValue.minAvailable = minAvailable;
            _resultValue.selector = selector;
            return _resultValue;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy