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

com.pulumi.kubernetes.policy.v1.outputs.PodDisruptionBudgetStatusPatch 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.v1.outputs;

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

@CustomType
public final class PodDisruptionBudgetStatusPatch {
    /**
     * @return 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.
     * 
     */
    private @Nullable List conditions;
    /**
     * @return current number of healthy pods
     * 
     */
    private @Nullable Integer currentHealthy;
    /**
     * @return minimum desired number of healthy pods
     * 
     */
    private @Nullable Integer desiredHealthy;
    /**
     * @return 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.
     * 
     */
    private @Nullable Map disruptedPods;
    /**
     * @return Number of pod disruptions that are currently allowed.
     * 
     */
    private @Nullable Integer disruptionsAllowed;
    /**
     * @return total number of pods counted by this disruption budget
     * 
     */
    private @Nullable Integer expectedPods;
    /**
     * @return 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.
     * 
     */
    private @Nullable Integer observedGeneration;

    private PodDisruptionBudgetStatusPatch() {}
    /**
     * @return 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.
     * 
     */
    public List conditions() {
        return this.conditions == null ? List.of() : this.conditions;
    }
    /**
     * @return current number of healthy pods
     * 
     */
    public Optional currentHealthy() {
        return Optional.ofNullable(this.currentHealthy);
    }
    /**
     * @return minimum desired number of healthy pods
     * 
     */
    public Optional desiredHealthy() {
        return Optional.ofNullable(this.desiredHealthy);
    }
    /**
     * @return 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.
     * 
     */
    public Map disruptedPods() {
        return this.disruptedPods == null ? Map.of() : this.disruptedPods;
    }
    /**
     * @return Number of pod disruptions that are currently allowed.
     * 
     */
    public Optional disruptionsAllowed() {
        return Optional.ofNullable(this.disruptionsAllowed);
    }
    /**
     * @return total number of pods counted by this disruption budget
     * 
     */
    public Optional expectedPods() {
        return Optional.ofNullable(this.expectedPods);
    }
    /**
     * @return 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 Optional observedGeneration() {
        return Optional.ofNullable(this.observedGeneration);
    }

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

    public static Builder builder(PodDisruptionBudgetStatusPatch defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List conditions;
        private @Nullable Integer currentHealthy;
        private @Nullable Integer desiredHealthy;
        private @Nullable Map disruptedPods;
        private @Nullable Integer disruptionsAllowed;
        private @Nullable Integer expectedPods;
        private @Nullable Integer observedGeneration;
        public Builder() {}
        public Builder(PodDisruptionBudgetStatusPatch defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.conditions = defaults.conditions;
    	      this.currentHealthy = defaults.currentHealthy;
    	      this.desiredHealthy = defaults.desiredHealthy;
    	      this.disruptedPods = defaults.disruptedPods;
    	      this.disruptionsAllowed = defaults.disruptionsAllowed;
    	      this.expectedPods = defaults.expectedPods;
    	      this.observedGeneration = defaults.observedGeneration;
        }

        @CustomType.Setter
        public Builder conditions(@Nullable List conditions) {

            this.conditions = conditions;
            return this;
        }
        public Builder conditions(ConditionPatch... conditions) {
            return conditions(List.of(conditions));
        }
        @CustomType.Setter
        public Builder currentHealthy(@Nullable Integer currentHealthy) {

            this.currentHealthy = currentHealthy;
            return this;
        }
        @CustomType.Setter
        public Builder desiredHealthy(@Nullable Integer desiredHealthy) {

            this.desiredHealthy = desiredHealthy;
            return this;
        }
        @CustomType.Setter
        public Builder disruptedPods(@Nullable Map disruptedPods) {

            this.disruptedPods = disruptedPods;
            return this;
        }
        @CustomType.Setter
        public Builder disruptionsAllowed(@Nullable Integer disruptionsAllowed) {

            this.disruptionsAllowed = disruptionsAllowed;
            return this;
        }
        @CustomType.Setter
        public Builder expectedPods(@Nullable Integer expectedPods) {

            this.expectedPods = expectedPods;
            return this;
        }
        @CustomType.Setter
        public Builder observedGeneration(@Nullable Integer observedGeneration) {

            this.observedGeneration = observedGeneration;
            return this;
        }
        public PodDisruptionBudgetStatusPatch build() {
            final var _resultValue = new PodDisruptionBudgetStatusPatch();
            _resultValue.conditions = conditions;
            _resultValue.currentHealthy = currentHealthy;
            _resultValue.desiredHealthy = desiredHealthy;
            _resultValue.disruptedPods = disruptedPods;
            _resultValue.disruptionsAllowed = disruptionsAllowed;
            _resultValue.expectedPods = expectedPods;
            _resultValue.observedGeneration = observedGeneration;
            return _resultValue;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy